i am trying to check an auto generated span class="" content , which i will use it as a condition to determine whether i will show a message to the user or not
here is the span
<span id="sprytextfield1" class="textfieldInvalidFormatState">
what i tried here is to put a Div called email with an id so i can use the following
if ($('email').html('<span id="sprytextfield1" class="textfieldInvalidFormatState">'))
{
alert ("error");
}
but this did not work because if put the span inside my div email this will stop the JavaScript and result in error, because for some data condition i can not close the div at the end of the span.
is there any way to get the span class without putting all the span inside a div ?
Check: http://jsfiddle.net/pratik136/YY5RR/
This will let you get the class of all spans.