MCQs > IT & Programming > JavaScript > Consider the following JavaScript function to change the color of the text box named txtName: function color(col) { document.forms[0].txtName.style.background=col } Which of the following will change the color of the text box to green, as long as the user is pressing a key?

JavaScript MCQs

Consider the following JavaScript function to change the color of the text box named txtName: function color(col) { document.forms[0].txtName.style.background=col } Which of the following will change the color of the text box to green, as long as the user is pressing a key?

Answer

Correct Answer: input type="text" onkeydown="color('green')" onkeyup="color('white')" name="txtName"

Explanation:

Note: This Question is unanswered, help us to find answer for this one

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

search

JavaScript Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it