O'Reilly Forums: Ch 3, Pg. 92 Another Way To Do Unbind - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Ch 3, Pg. 92 Another Way To Do Unbind

#1 User is offline   jsanfil 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 19-February 12

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?
0

#2 User is offline   jsanfil 

  • New Member
  • Pip
  • Group: Members
  • Posts: 3
  • Joined: 19-February 12

Posted 20 February 2012 - 12:58 PM

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

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users