У меня возникла проблема при попытке идентифицировать INPUT с пустым значением или у которого есть только атрибут value без = "". См. Ниже мой код.Ввод формы с пустым значением
<form id='form'>
<div class='input-field col s12'>
<input id='title' type='text' value>
<label for='title'>Job Tilte</label>
</div>
<div class='input-field col s12'>
<input type='text' id='company' value='test' />
<label for='company'>Company Name</label>
</div>
<div class='input-field col s12'>
<input type='text' id='telephone' value='' />
<label for='telephone'>Telephone Number</label>
</div>
<div class='input-field col s12'>
<textarea id='description' placeholder='test2'></textarea>
<label for='description'>About you</label>
</div>
<div class='input-field col s12'>
<input type='password' id='password' />
<label for='password'>Your password</label>
</div>
<div class='input-field col s12'>
<input type='password' id='re-password' />
<label for='re-password'>Confirm your password</label>
</div>
<input type='submit' disabled='disabled' value='Update' id='sendbutton' />
И это мой JQuery:
if ($('#form input').val().length !== 0) {
$(this).hide();
} else {
$(this).next().addClass('active');
}
Может кто-нибудь помочь мне с этим вопросом? Спасибо заранее.