$("#divid").click(function(event){
         event.stopPropagation(); 
...

})

-----Original Message-----
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Qiangning Hong
Sent: jeudi 17 mai 2007 11:49
To: jQuery (English)
Subject: [jQuery] avoid event bubbling to ancestors but still activate the
default action?


I have an A in a DIV:

  <div id="divid"><a href="somewhere" id="aid">asdf</a></div>

and bind the click event of the div:

  $("#divid").click(function() { ... })

Now I want the click of A execute the default action, i.e. go to another
page, without execute the div event function.  How to do this?  "return
false" doesn't work.

Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.467 / Base de données virus: 269.7.1/807 - Date: 16/05/2007
18:05
 

Reply via email to