In jquery form validation the keyup is not working mozilla but working fine in chrome.
here is the Javascript code
function validate() {
var msg;
if(document.myForm.userPass.value.length>5)
msg="good";
else
msg="poor";
document.getElementById("mylocation").innerText=msg;
}
here is the html code
<form name="myForm">
<input type="password" value="" name="userPass" onkeyup="validate()">
Strength:<span id="mylocation">no strength</span>
</form>
From this answer it tells that Firefox doesn't take
innerText
orinnerHTML
to set a value, rather it takestextContent
to set a value. So usetextContent
to set your value if the browser is FirefoxDEMO
To identify different browsers you can use below code from this answer