Hương Trang
New member
What will be the output of the following JavaScript code?
A. Strength: good
B. Strength: poor
C. Strength: no strength
D. Undefined
Code:
function validate()
{
var msg;
if(document.myForm.userPass.value.length>5)
{
msg="good";
}
else
{
msg="poor";
}
document.getElementById('mylocation').innerText=msg;
}
<form name="myForm">
<input type="password" value="rhuld" onkeyup="validate()">
Strength:<span id="mylocation">no strength</span>
</form>
B. Strength: poor
C. Strength: no strength
D. Undefined