jQuery – find a class exist or not and return true/false value

<div id=”sizes”>
<a >1</a>
<a >2</a>
<a >3</a>
</div>

==============Jquery=======

var $aSelected = jQuery(‘div.sizes’).find(‘a’);
if( $aSelected.hasClass(‘sizelinksel’) ){
var right1 = true;
}else{
var right1 = false;
}

Advertisements