check if label by a specific name exists,
Say if i want to find if such label exists
<label onClick='javascript:someMethod()' name="label_name">*some text*</label>
if so then i need to implement some code.
Try This in condition loop -- $('label[name="label_name"]').length
Try
var x = $('label[name="label_name"]');
if(x.length){
    //label exists
}
                        if ($('label[name="label_name"]').length) {
    alert('Label exists');
}
                        if($('label[name="label_name"]').length)
{
    //code
}
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With