MCQs > IT & Programming > DHTML > This is a JavaScript function for changing the color of the text box named 'txtName': function SetColor(col) { document.forms[0].txtName.style.background=col } How will you change the color of the text box txtName to green, only for the time that the user is pressing any key?

DHTML MCQs

This is a JavaScript function for changing the color of the text box named "txtName":

function SetColor(col)

{ document.forms[0].txtName.style.background=col }

How will you change the color of the text box txtName to green, only for the time that the user is pressing any key?

Answer

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

Explanation:

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

DHTML Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it

More DHTML MCQ Questions

search

DHTML Skill Assessment

Overall Skill Level-Poor

Your Skill Level: Poor

Retake Quizzes to improve it