Trying to add a class to a button if there has been any input in one of six text fields on the page. Getting a console error that says "Uncaught TypeError: Object [object Object] has no method 'value'
" referring to my var val
line.
Syntaxual? Thanks for your help.
HTML:
<input id="a" class="answer" type="text">
<input id="b" class="answer" type="text">
JavaScript:
var val = $('.answer').each(function(){
$(this).value();
});
if (/^\s*$/.test(val)){
$('#theOne').addClass('show');
}