Jump to content


Photo

Ch 3, Pg. 92 Another Way To Do Unbind


  • Please log in to reply
1 reply to this topic

#1 jsanfil

jsanfil

    New Member

  • Members
  • Pip
  • 3 posts

Posted 19 February 2012 - 06:47 PM

This page shows how to remove the click event from each .guess_box element.

$(".guess_box").each( function() {
   $(this).unbind("click");

But I also tried the code below and it seems to work.

$(".guess_box").unbind("click");

Is it necessary to use "each" to explicitly loop through each element or will JQuery automatically call the method on all elements that match a selector?

#2 jsanfil

jsanfil

    New Member

  • Members
  • Pip
  • 3 posts

Posted 20 February 2012 - 12:58 PM

Sorry, posted in the wrong forum. This is for Head First jQuery.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users