Header AD

HTML Elements, Attributes, and Positions on jQuery

HTML Elements, Attributes, and Positions:
Following are some order selectors and examples of their use with elements

in the preceding code:


radio: Selects all elements with the type attribute set to radio. The
following code returns the value 1 in an alert box:
alert( $(‘:radio’).length);


checkbox: Selects all elements with type attribute set to radio. The following code sets the checked attribute to true for all check boxes:

$(‘:checkbox’).attr({checked:’true’});



[attribute]: Selects all elements with a specific attribute. The following

code displays the number of <img> elements with a height attribute:

alert( $(‘img[height]’).length);


[attribute=value]: Selects all elements with a particular attribute set to a specific value. The following code displays the number of elements with a class attribute set to myclass:

alert( $(‘[class=myclass]’).length);



[attribute!=value]: Selects all elements with a particular attribute not set to a specific value. The following code displays the number of
elements with a class attribute that isn’t myclass. Elements with no class attribute are ignored:

alert( $(‘[class!=myclass]’).length);    

Free create back link
Meta tag generator 4 seo
Meta description taG
Free link for PR3
Website optimization technique


HTML Elements, Attributes, and Positions on jQuery HTML Elements, Attributes, and Positions on jQuery Reviewed by Unknown on 4:02 PM Rating: 5

No comments

Post AD