I have this HTML or mark up .
<fieldset class="ui-dform-fieldset">
<input type="text" id="totalRetryCount" name="totalRetryCount" tabindex="1" onblur="validateElement('Configuration', 'testSuiteConfigurationform','totalRetryCount')" class="ui-dform-text">
<legend class="ui-dform-legend">Total Retry Count</legend>
<label for="totalRetryCount" class="error">Please enter a valid number.</label>
</fieldset>
I want to check whether label have error class or not.I did like that
when I debug my element value is "totalRetryCount" .But it is not showing alert.
element ="totalRetryCount"
if($("#"+element+" "+"label").hasClass('error')){
alert('-sdafs-')
}