Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
21
rated 0 times [  27] [ 6]  / answers: 1 / hits: 76618  / 13 Years ago, thu, august 11, 2011, 12:00:00

Possible Duplicate:

jQuery equivalent of JavaScript's addEventListener method




Also from a very good jQuery tutorial on : http://itunes.apple.com/in/app/designmobileweb/id486198804?mt=8


What is the jQuery equivalent for the following statement;


element1.addEventListener('click',doSomething2,false)

If it is the bind() method, is there any option to specify the last parameter (i.e. event bubbling or capturing ... true/false)


More From » jquery

 Answers
139

Try this



// Setting the third argument to false will attach a function
// that prevents the default action from occurring and
// stops the event from bubbling.
$(#element1).bind(click, doSomething2, false);

[#90678] Wednesday, August 10, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
patienceannel

Total Points: 674
Total Questions: 101
Total Answers: 101

Location: Northern Mariana Islands
Member since Fri, Jan 15, 2021
3 Years ago
;