I am using JQuery to find a String of text within an element using the following –
<li>
<input type="checkbox" value="14">
<a id="link-filterattribute-14" class=" jqueryCheck" rel="nofollow" href="/store/filtered/4/12_14/c_7/"> Black </a>
</li>
<script>
if ($(".jqueryCheck:contains('Black')").length){
}
</script>
What I want to do is add a class to the <input> If the word “Balck” is found. How do I go about this?
Thanks
You could do