Hi Michael,

I think you might have misunderstood my problem.  The div.text.click
is firing properly, it's the a.click that isn't firing.

---

On 8/21/07, John Beppu wrote:
> The click() function doesn't actually simulate a click.
> It's true purpose is to setup on onclick handler.

New question:
How do I simulate a click?

Thanks in advance.
jliu

On Aug 22, 1:24 pm, "Michael E. Carluen" <[EMAIL PROTECTED]>
wrote:
> John:
>
> Try using bind(); with click()
>
> $("div.test").bind("click", function(){
>          $("a").click();
>
> });
>
> Hth,
>
> Michael
>
> > -----Original Message-----
> > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> > Behalf Of John Liu
> > Sent: Tuesday, August 21, 2007 6:53 PM
> > To: jQuery (English)
> > Subject: [jQuery] divert click to an anchor
>
> > <html><head>
> > <script language=javascript src="jquery-1.1.3.1.js"></script>
> > <script language=javascript>
> > $(document).ready(function(){
> >   $("div.test").click(function(){
> >      alert('div.test clicked');
> >      $("a").click();
> >   });
> > });
> > </script></head><body>
> > <a href="http://google.com";> google </a>
> > <div class='test'>click</div>
> > </body></html>
>
> > I have a situation where if anyone clicks anywhere within the div, I
> > want the anchor to be fired - in this case, navigate to google.com.
> > Why doesn't the above code work?
>
> > thanks in advance.
> > jliu

Reply via email to