JSFiddle - React, Tailwind, and code Playground

by jim3481

HTML

<form name="regform" id="regform" method="POST" action="">
    <input name="password" type="password" maxlength="10" id="password" />
    <span id="status2"></span>
    <input name="repassword" type="password" maxlength="10" id="repassword" />
    <span id="status3"></span>
    <input type="submit" name="Submit" value="Registrarte" id="ctl00" disabled="disabled" />
</form>

JavaScript

$(document).ready(function()
{

var btnNext = document.getElementById("ctl00");

$("#password").change(function()
{
var password = $("#password").val();
if(password.length < 6) {$("#status2").html('<b><font color="#cc0000">Contraseña Invalida<font></b>');}
else {$("#status2").html('<img src="yes.png" width="18px">');}
});
                         
$("#repassword").change(function()
{
var password = $("#password").val();
var repassword = $("#repassword").val();
if(repassword.length < 6) {$("#status3").html('<b><font color="#cc0000">Contraseña Invalida</font></b>');}
else if(repassword != password) {$("#status3").html('<b><font color="#cc0000">La Contraseña no coincide</font></b>');}
else {$("#status3").html('<img src="yes.png" width="18px">');}
});
                                 
});