文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>JSP文本框获得焦点和失去焦点时变色

JSP文本框获得焦点和失去焦点时变色

时间:2010-06-18  来源:fucuihong

function   appendit() 
  { 
  var   nodes   =   document.getElementsByTagName("INPUT"); 
  for   (var   i=0;   i<nodes.length;   i++) 
  { 
  var   ctype   =   nodes[i].getAttribute("type"); 
  if   (ctype   ==   'text') 
  { 
  nodes[i].onfocus   =   function   ()   {   this.style.backgroundColor='#33FF00';   } 
  nodes[i].onblur   =   function   ()   {   this.style.backgroundColor='#3366FF';   } 
  } 
  } 
  }  

只要在每个页面的BODY改成<BODY   onload="appendit();">,再把上述JS(JavaScript)脚本引入即可。
相关阅读 更多 +
排行榜 更多 +
冲破牢笼手机版

冲破牢笼手机版

飞行射击 下载
冲突2西线安卓版

冲突2西线安卓版

飞行射击 下载
全部刺中

全部刺中

飞行射击 下载