javascript - Get the id of <li> tag containing a specific value -
i have list as:
<ul> <li id="l1">1</li> <li id="l2">2</li> <li id="l3">hi</li> </ul>
by using jquery, got know if <li>
contains value(say) hi. used:
if($('li:contains('hi')')){ alert('got value'); }
now want know id of <li>
in found value 'hi'. how id?
Comments
Post a Comment