JSFiddle - React, Tailwind, and code Playground
by saru
HTML
<p>Password<input type="password" name="pass" id="pass" size=18 maxlength=50 required></p>
<p>Confirm Password<input type="password" name="cpass" id="cpass" size=18 maxlength=50 required><span id='message'></span></p>
<p>Phone<input type="text" name="phone" id="phone" size=18 maxlength=50 disabled></p>
CSS
input {
display: inline-block;
float: right;
margin-right:20%;
}
span{
float:right;
margin-right:1%;
}
JavaScript
$('#pass, #cpass').on('keyup', function () {
if ($('#pass').val() == $('#cpass').val()) {
$('#message').html('matching').css('color', 'green');
$("#phone").prop('disabled', false);
}
else{ $('#message').html('not matching').css('color', 'red');
$("#phone").prop('disabled', true);}
});