关于CSS的问题请教大家。 请问我怎样可以做到单击页面里某一个文本框他的底色就会变成黄色,其它的就恢复到正常色(白色) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <tr style=cursor:hand onMouseOver=this.style.backgroundColor='#DCF1E0' onMouseOut=this.style.background='#FFFFFF'> <asp:textbox id="textbox1" onfocus="a()" onblur="b()"><script language="c#">public void a(object ...){textbox1.forcecolor="#******";}public void b(object ...){textbox1.forcecolor="#******";}</script> shoushii(守矢)有JAVASCRIPT的吗,你这个好像是C#做的 改变对象的className就可以实现了<style>.ccc{bgcolor:yellow}obj.className="ccc";就Ok了http://www.lbsxp.com <!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=gb2312" /><title>无标题文档</title><style type="text/css">input {changeColor:expression(onfocus=function(){changeColor(this)});restoreColor:expression(onblur=function(){restoreColor(this)});}</style></head><body><form id="form1" name="form1" method="post" action=""> <label> <input type="text" name="textfield" /> </label> <label> <input type="text" name="textfield2" /> </label></form></body></html> <script language="javascript"> function changeColor(obj){ obj.style.backgroundColor="yellow" } function restoreColor(obj){ obj.style.backgroundColor=""; } </script> 哈好久没用css批量控制样式了,顺便用用这个复习一下,兄弟可以参考一下的,当然未必要用这种css批量控制的方法啊 如果做一个通用的放在一个CSS里可以吗 sql 中读取数据然后再写入oracle中 .net 正则表达式 去除汉字的怎么写? 博客系统的一个问题 100分悬赏:QQ空间的相片上传用.NET怎么实现 后台实现数据表导入 如何控制Panel的最大高度? 请问什么是组件?什么是控件? 100分请高人帮忙解释一下这几个函数 大家看一下这个错误出在那里,好郁闷! ajex(仙桃人) 近来领分 求助~~查询得到的数据源,我如何得到其中的第一条记录 如何让最匹配关键字的搜索结果优先显示?
<script language="c#">
public void a(object ...)
{
textbox1.forcecolor="#******";
}
public void b(object ...)
{
textbox1.forcecolor="#******";
}
</script>
.ccc{bgcolor:yellow}
obj.className="ccc";就Ok了http://www.lbsxp.com
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
input {changeColor:expression(onfocus=function(){changeColor(this)});restoreColor:expression(onblur=function(){restoreColor(this)});}
</style></head><body>
<form id="form1" name="form1" method="post" action="">
<label>
<input type="text" name="textfield" />
</label>
<label>
<input type="text" name="textfield2" />
</label>
</form></body>
</html>
<script language="javascript"> function changeColor(obj)
{
obj.style.backgroundColor="yellow"
}
function restoreColor(obj)
{
obj.style.backgroundColor="";
}
</script>