2
Answers

get span error status

Shakil Ahmed

Shakil Ahmed

7y
177
1
 i used this code for show text box error in span.
now i want return status - true or false  based on showing message
 
if ($('#Code-Id').val().trim() < 2) {
$('#Code-Id').siblings('span.error').css('visibility', 'visible');
}
else {
$('#Code-Id').siblings('span.error').css('visibility', 'hidden');
}
Answers (2)
0
Shakil Ahmed

Shakil Ahmed

NA 49 1.2k 7y
i solved this another way,thanks 
0
Amit Kumar

Amit Kumar

NA 3.5k 203.6k 7y
Hi, 
    Use .css like .css({"visibility":"hidden"}); and create a proper element id not use  dash(- ) between .
   Example:   $("#Code-Id").css({"visibility":"hidden"});
 
After that your problem is not resolve then share error screenshot.
 
Regards,
Amit