Select elements by | Example | worked / not | jQuery Syntax Examples | Corrosponding HTML Code | Comment | |
1 | by name | example | it worked | jQuery code $('p') $('div') |
by it's html tag <p></p> <div> |
the p & the div matches it all up |
2 | by id | example | it worked | jQuery code $('#impPrg') $('#myDiv2') |
by it's html tag id property <p id="impPrg"> <div id="myDiv2"> |
note how they match up thru the tag's id property |
3 | by attribute | example | it worked | $('[class]') | <p id="impPrg" class="boldPrg"> | answers the question of "is the class property assigned, yes or no". |
4 | by attribute by value | example | it worked | $('[class="yellowDiv"]') | <div id="myDiv2" class="yellowDiv"> | yellowDiv wass assigned some CSS properties in the style selection of the head section of the html document |
My First JavaScript