I have a hidden element called ShowUsername that I want to show if the user inputs a username that is less than 8 characters. I can't seem to figure this out if someone could help me out. I currently have the element hidden and it stays hidden if the string input is 8 or more characters.
var myPassword = document.getElementById("Password");
var myUserName = document.getElementById("Username");
document.getElementById("frmRegister").onsubmit = function() {
<!-- Username must be 8 or more characters -->
if (myUserName.value.length >= 8) {
alert("YOur Username was saved");
} else {
ShowUsername.display;
}
}