js如何实现文本框中的颜色变化

   阅读
js怎么实现文本框中的颜色变化
需求:html中input文本框,当获得焦点时,文本框的颜色变化,失去焦点时,恢复原来的颜色。这个用JS怎么弄啊?不用JS也可以,只要能实现在“获得/失去焦点”能改变文本框的颜色,这个都可以。
希望各位大侠能够帮一下小弟啊!

------解决方案--------------------
document.getElementById('some_input_id').style.color = '#abcdef';
------解决方案--------------------
使用Jquery 异常的简单...详细Demo + QQ 409零20100
------解决方案--------------------
HTML code

 <input type="input" onFocus="this.style.backgroundColor='red'" onblur="this.style.backgroundColor='white'" value="颜色变化">

------解决方案--------------------
探讨
HTML code


<input type="input" onFocus="this.style.backgroundColor='red'" onblur="this.style.backgroundColor='white'" value="颜色变化">
阅读