为了账号安全,请及时绑定邮箱和手机立即绑定

鼠标划过文本框改变其背景颜色,不知道错哪了

鼠标划过文本框改变其背景颜色,不知道错哪了

qq_小盛开_0 2016-10-27 16:44:48
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><body style="text-align:center" onload="init();">      <input type="text"  /><br /><br />      <input type="text"  />      <script type="text/javascript">          function init(){  var d=document.getElementsByName("input");  for(var i=0;i<d.length;i++){     d[i].onmouseover=function(){ this.style.backgroundColor="red"; }     d[i].onmouseout=function(){ this.style.backgroundColor=""; }  }  }  </script></body></html>
查看完整描述
  • 3 回答
  • 0 关注
  • 1553 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信