Single Choice
Easy
QWhat would the following JavaScript code produce?
function validate()
{
var msg;
if(document.myForm.userPass.value.length>5)
{
msg="good";
}
else
{
msg="poor";
}
document.getElementById('mylocation').innerText=msg;
}
ID: #5085
Javascript DOM & Event Handling MCQ
139 views
Question Info
#5085Q ID
EasyDifficulty
Javascript DOM & Event Handling MCQTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer
Explanation
Dynamic text can be written on an HTML document using the innerText property. It is primarily used in web sites to create dynamic content, such as producing the validation message or determining the security of a password.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic