Hi,

At the moment I'm not so interested in the right/smart way to write an
<a> tag. It's more interesting to me to see what the jQuery click()
function can and cannot do, and it could also be interesting to know
why it "fails" where my clickAt(...) works.
I have now extended my test page
<http://folk.uio.no/jkleiser/test/jq-test.html>
with two new <a> variants: one (#a2) "new-school" that uses 'onclick',
and one (#a3) that links to this Google Groups page. With the latter I
observe the same difference as with #a1: my clickAt($('#a3')[0])
works, but $('#a3').click() doesn't. Bug or feature?

/Jon

On Nov 19, 11:36 pm, Olaf Bosch <olaf.bo...@t-online.de> wrote:
> Jon schrieb:
>
> > Hi,
>
> > I have an element like this: <a id="a1" href="javascript:doSomething
> > ();">#a1</a>
> > However, when I do this: $('#a1').click(); ... then my doSomething()
> > do not get called. Why?
>
> Try the jQuery-Way:
>
> <a id="a1" href="#">#a1</a>
>
> $('#a1').click( function() {
>          doSomething();
>          return false;
>          });
>
> --
> Viele Gr e, Olaf
>
> -----------------------------------
> olaf.bo...@t-online.dehttp://olaf-bosch.de/http://ohorn.info/http://www.akitafreund.de/
> -----------------------------------

Reply via email to