メモ書き。
フォーカスされたテキストボックスの背景色を変更するには次のようにする。
window.onload = function(){ function input_focused() { this.style.backgroundColor="#DFF"; } function input_blured() { this.style.backgroundColor=""; } len = document.forms[0].elements.length; for(i = 0; i < len; i++) { if (document.forms[0].elements[i].type == "text") { document.forms[0].elements[i].onfocus = input_focused; document.forms[0].elements[i].onblur = input_blured; } } }