JSFiddle - React, Tailwind, and code Playground
HTML
<form>Username
<br />
<input type="text" id="user_input" name="username" />
<br />Password
<br />
<input type="text" id="pass_input" name="password" />
<br />Confirm Password
<br />
<input type="text" id="v_pass_input" name="v_password" />
<br />Email
<br />
<input type="text" id="email" name="email" />
<br />
<input type="submit" id="register" value="Register" disabled="disabled" />
</form>
<div id="test"></div>
<script>
(function() {
$('form > input').keyup(function() {
var empty = false;
$('form > input').each(function() {
if ($(this).val() == '') {
empty = true;
}
});
if (empty) {
$('#register').attr('disabled', 'disabled'); // updated according to http://stackoverflow.com/questions/7637790/how-to-remove-disabled-attribute-with-jquery-ie
} else {
$('#register').removeAttr('disabled'); // updated according to http://stackoverflow.com/questions/7637790/how-to-remove-disabled-attribute-with-jquery-ie
}
});
})();
</script>