To select an item by attribute value, you can use this syntax:
$('[attribName="value here"]')
Where attribName should be replaced with an attribute name such as name , title , etc.
To add a new attribute value, you can use the attr method.
Example:
$('[attribName="value here"]').attr('attribute name', 'attribute value');
And you can change the background color:
$('[attribName="value here"]').css('background-color', 'green');
Please note that you must replace the names and values ββof the attribute attributes to suit your requirements.
Sarfraz Sep 16 '10 at 6:41 2010-09-16 06:41
source share