-
Book Overview & Buying
-
Table Of Contents
jQuery 1.4 Reference Guide
The following selectors are based on the Cascading Style Sheet specifications (1–3), as outlined by the W3C. For more information about the specifications, visit http://www.w3.org/Style/CSS/#specs.
Select all elements that have a tag name of T.
$('div') selects all elements with a tag name of div in the document
$('em') selects all elements with a tag name of em in the document
JavaScript's getElementsByTagName() function is called to return the appropriate elements when this expression is used.
Select the unique element with an ID equal to myid.
$('#myid') selects the unique element with id="myid"
$('p#myid') selects a single paragraph with an ID of myid; in other words, the unique element <p id="myid">
Each ID value must be used only once within a document. If more than one element has been assigned the same ID, queries that use that ID will only select the first matched element in the DOM. However, this...
Change the font size
Change margin width
Change background colour