如何让鼠标onKeyDown的时候让input变色? 试试<script language="javasxcript">function changecolor(){ document.all.inputname.style="background:red"}</script> 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 鼠标是onClick,onMouseDown,键盘才有onKeyDown 这样试了但是没有成功,是数组的关系吗?<script language="javasxcript">function changecolor(){ document.all.textdata_A[].style="background:red" ; document.all.textdata_B[].style="background:red" ; document.all.textdata_C[].style="background:red" ; document.all.textdata_D[].style="background:red" ;}</script><?php do{ echo "<tr height=40 bgcolor=#cccccc >" ;echo "<td >".$row['VT4_0']."<font color=#FF0000>".$row['VT4_1']."</font></td>";echo "<td ><input name=textdata_A[] type=text onClick=changecolor()></td>";echo "<td ><input name=textdata_B[] type=text onClick=changecolor()></td>";echo "<td ><input name=textdata_C[] type=text onClick=changecolor()></td>";echo "<td ><input name=textdata_D[] type=text onClick=changecolor()></td>";echo "</tr>"; } while ($row= mssql_fetch_assoc($query)); ?> <input name=T1 size=20 onKeyDown="this.style.background='red';">获得焦点时好用~~~ 以上是键盘触发~~~鼠标的:<input name=T1 size=20 onclick="this.style.background='red';"> 感谢各位前辈给予的帮助,经过修正底下写的会比较适合 感谢 zltostem(尘寞)给予的帮助.<input name="textdataA" type=text onfocusout="this.style.background='#ffffff'" onfocusin="this.style.background='#cccccc'"><input name="textdataB" type=text onfocusout="this.style.background='#ffffff'" onfocusin="this.style.background='#cccccc'"><input name="textdataC" type=text onfocusout="this.style.background='#ffffff'" onfocusin="this.style.background='#cccccc'"><input name="textdataD" type=text onfocusout="this.style.background='#ffffff'" onfocusin="this.style.background='#cccccc'"> 求一个自动伸缩的列表控件 关于jquery换行的问题 JS与AS 高手进 冰天雪地跪地求教 JS中如何点击一个按钮然后转到页面的某个地方? prototype原型的一个问题 如何用JS保存XML?? 250个字符能实现javascript读取COOKIES再提交么?? 是否可以禁止用户按 Ctrl-N 恢复IE浏览器的原始状态? 有什么办法可以做到拒绝使用 tencent 的浏览器浏览? 怎么验证文框中输入时间(带分秒)的合法性,格式如2002-7-26 11:03:00 如何把网页的内容(或网页中的部份内空)转换成其它格式---Txt, DBF XLS XML
function changecolor()
{
document.all.textdata_A[].style="background:red" ;
document.all.textdata_B[].style="background:red" ;
document.all.textdata_C[].style="background:red" ;
document.all.textdata_D[].style="background:red" ;
}
</script><?php
do{ echo "<tr height=40 bgcolor=#cccccc >" ;
echo "<td >".$row['VT4_0']."<font color=#FF0000>".$row['VT4_1']."</font></td>";
echo "<td ><input name=textdata_A[] type=text onClick=changecolor()></td>";
echo "<td ><input name=textdata_B[] type=text onClick=changecolor()></td>";
echo "<td ><input name=textdata_C[] type=text onClick=changecolor()></td>";
echo "<td ><input name=textdata_D[] type=text onClick=changecolor()></td>";
echo "</tr>";
} while ($row= mssql_fetch_assoc($query)); ?>
感谢 zltostem(尘寞)给予的帮助.<input name="textdataA" type=text onfocusout="this.style.background='#ffffff'" onfocusin="this.style.background='#cccccc'">
<input name="textdataB" type=text onfocusout="this.style.background='#ffffff'" onfocusin="this.style.background='#cccccc'">
<input name="textdataC" type=text onfocusout="this.style.background='#ffffff'" onfocusin="this.style.background='#cccccc'">
<input name="textdataD" type=text onfocusout="this.style.background='#ffffff'" onfocusin="this.style.background='#cccccc'">