User Tools

Site Tools


quickref:jquery

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

quickref:jquery [2013/02/28 15:38]
andy created
quickref:jquery [2013/02/28 15:56] (current)
andy
Line 38: Line 38:
 ^ ''​%%$("​a"​)%%''​ | This is a jQuery selector, returning a jQuery object representing all ''<​a>''​ elements within the DOM, in this example. | ^ ''​%%$("​a"​)%%''​ | This is a jQuery selector, returning a jQuery object representing all ''<​a>''​ elements within the DOM, in this example. |
 ^ ''​%%.click(...)%%''​ | Installs a click handler on the specified set of elements, similar to the ''​onclick''​ attribute of HTML elements. As with ''​.ready()''​ this takes a function as a parameter. | ^ ''​%%.click(...)%%''​ | Installs a click handler on the specified set of elements, similar to the ''​onclick''​ attribute of HTML elements. As with ''​.ready()''​ this takes a function as a parameter. |
 +
 +
 +===== Selectors =====
 +
 +There are two ways to select attributes in jQuery, both of which can be combined:
 +
 +  * **CSS and XPath selectors passed to the ''​jQuery''​ object.**\\ This was the approach demonstrated in the example above. Other examples includes **''#​item''​** to select tags with a specified ''​id''​ and **''​.title''​** to select tags with the specified CSS class. Many selectors can take another selector as a "​parameter"​ and modify it. See [[http://​api.jquery.com/​category/​selectors/​|the full list]] for more details.
 +  * **Some methods of the ''​jQuery''​ object act as selectors, returning a restricted set of elements.**\\ An example of this is the ''​[[http://​api.jquery.com/​not/​|not()]]''​ method, which filters the set of items returned to be those not matching the specified selector.
  
  
quickref/jquery.1362065922.txt.gz ยท Last modified: 2013/02/28 15:38 by andy