javascript - jQuery : select all element with custom attribute -
possible duplicate:
jquery, select attribute value, adding new attribute
jquery - how select attribute
please consider code:
<p>11111111111111</p> <p mytag="nima">2222222222</p> <p>33333333333</p> <p mytag="sara">>4444444444</p>
how can select p
tag attribute mytag
?
thanks
$('p[mytag]')
or select 1 attribute has specific value:
$('p[mytag="sara"]')
there other selectors "attribute value starts with", "attribute value contains", etc.
Comments
Post a Comment