a simple example of an attribute selector
- i have the class
item1 - i have the class
item2 - i have the class
item3 - i have the class
irrelevant - i have no class!
the selector looks like this:
$('li[@class^=item]').css('backgroundColor','yellow');
Simplifying:
$('li').css('listStyleType','square');
Select all <li> elements (and make their dot square)
$('li[@class]').css('fontSize','200%');
Select all <li> elements that have any class at all (and make their font bigger)
$('li[@class^=item]').css('backgroundColor','yellow');
Select all <li> elements that have a class which begins with the pattern item (and give them a yellow background)