js怎么实现文本框中的颜色变化 document.getElementById('some_input_id').style.color = '#abcdef'; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 使用Jquery 异常的简单...详细Demo + QQ 409零20100 我下班了...See http://jquery.com/看一下里面的几个DEMO Jquery有几个极大的好处简单易学,只要学会了选择器,就可以做出很绚丽的效果轻量级解决方案,Min才几十k的大小插件非常的丰富,基于Jquery可以完成很多特效,因为本身JQuery就是JS的框架 <html> <body> <form name="testForm"> <input type="input" id="somId" name="UserName" onFocus="document.getElementById('somId').style.backgroundColor='#eee'" onblur="document.getElementById('somId').style.backgroundColor='#fff'" value="Test"> </form> </body></html> <input type="input" onFocus="this.style.backgroundColor='red'" onblur="this.style.backgroundColor='white'" value="颜色变化"> <input type="input" onFocus="this.style.backgroundColor='red'" onblur="this.style.backgroundColor=''" value="颜色变化">你说的这个不算问题 移开的时候不设置背景颜色就行可 主要是解决问题的思路 其实根本无需用到jquery之类的库 如果不用jquery,那input很多的时候,岂不是要一个一个设置,那多麻烦啊。 [code=javascript]<script type="text/javascript"> function bs() { document.getElementById("ys").style.backgroundColor="#123321"; } function bk() { document.getElementById("ys").style.backgroundColor="red"; }</script><body> <input type="text" name="s" id="ys" value="变颜色" onFocus="bs()" onblur="bk()" ></body>[/code] response.getWriter()的作用 htmlunit表单提交求教 如何实现后台自动刷新? 求助:struts 1.3,同一页面做增删改查 struts-tiles配置问题 spring,hibernate配置proxool的问题 Tapestry写计数器问题 response.getOutputStream() 路径没错 weblogic的在jb里启动,war可以访问ejb,但在jb外部启动就出错。 如何更改MyEclipse的Deployment配置 请大伙看看这两代码结果都还ok 就是不知道 效率更好些
<html>
<body>
<form name="testForm">
<input type="input" id="somId" name="UserName"
onFocus="document.getElementById('somId').style.backgroundColor='#eee'"
onblur="document.getElementById('somId').style.backgroundColor='#fff'"
value="Test">
</form>
</body>
</html>
<input type="input" onFocus="this.style.backgroundColor='red'" onblur="this.style.backgroundColor='white'" value="颜色变化">
onFocus="this.style.backgroundColor='red'"
onblur="this.style.backgroundColor=''" value="颜色变化">你说的这个不算问题 移开的时候不设置背景颜色就行可
主要是解决问题的思路 其实根本无需用到jquery之类的库
function bs()
{
document.getElementById("ys").style.backgroundColor="#123321";
}
function bk()
{
document.getElementById("ys").style.backgroundColor="red";
}
</script>
<body>
<input type="text" name="s" id="ys" value="变颜色" onFocus="bs()" onblur="bk()" >
</body>[/code]