Question: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 } You want that the color of the text box should change to green only while the user is pressing a key?
A <input type=''text'' onkeypress=''color('green')'' onkeyup=''color('white')'' name=''txtName''>
B <input type=''text'' onkeydown=''color('white')'' onkeyup="color('green')'' name=''txtName''>
C <input type=''text'' onkeydown=''color('green')'' onkeyup=''color('white')'' name=''txtName''>
D <input type=''text'' onkeydown=''color('green')'' name=''txtName''>
+ AnswerA
+ Report