Posted By

Meander365 on 09/19/10


jquery cookbook

Versions (?)

Jquery - Using the Context Parameter (2.11)

 / Published in: jQuery

Notice this as the second argument - this refers to the form. Since it's set as the context, jQuery will only return input elements within that form.

You can also pass a regular expression in as the context - if you wanted to use a certain characteristics based selection.

  1. $("form").submit("bind", function() {
  2. var allInput = $("input", this);
  3. // do something with all inputs inside the form
  4. });

Report this snippet  

You need to login to post a comment.