this code doesnt seem to be working, label shows fora second then its gone

function validate(){


getUser=document.getElementById("username");
getLabel=document.getElementById("labelUser");


if
(getUser.value.length>=5){
getLabel.innerHTML="Valid username";
getLabel.style.color="green";
return true;
}

else{
getLabel.innerHTML="invalid username";
getLabel.style.color="red";
return false;
}






<form onsubmit="return validate()">

<input id="username" type = "text"/>
<input type="submit" value="submit"/>
<br/>
<label id="labelUser" for="username"></label>

</form>