84669 personnes étudient
152542 personnes étudient
20005 personnes étudient
5487 personnes étudient
7821 personnes étudient
359900 personnes étudient
3350 personnes étudient
180660 personnes étudient
48569 personnes étudient
18603 personnes étudient
40936 personnes étudient
1549 personnes étudient
1183 personnes étudient
32909 personnes étudient
在javascript中,可以使用onfocus事件设置文本框输入时变颜色,只需要给元素绑定onfocus事件,再使用“对象.style.background="颜色值"”即可。onfocus事件在对象获得焦点时发生,通常用于表单中。
本教程操作环境:windows7系统、javascript1.8.5版、Dell G3电脑。
动态设置文本框颜色:
主要是利用javascript中的触发事件onfocus