一个简单功能,大家帮我解一下,在线等
当焦点在文本框amount时,文本框后面的文字加上一个样式,当焦点离开文本框amount时,文本框后面的样式去掉,请问function clow()怎么写
代码如下:
<table width= "100% " border= "0 " cellspacing= "0 " cellpadding= "0 ">
<tr>
<td width= "16% "> <input name= "amount " type= "text " id= "amount " onFocus= "clew() " onKeyPress= "javascript:CheckNum(); " value= " <%=cc( "total ")%> " size= "20 " maxlength= "20 "> </td>
<td width= "84% "> <div style= " background-color:#FFdddd;width:400;line-height:23px;border-style:solid; border-width: 1pt;border-color:#ff0000 "> 库仓还有该材料库存 <b> <font color=red> <%=cc( "amount ")%> </font> </b> ,计划生产产品数 <b> <font color=red> <%=cc( "plannum ")%> </font> </b> </div> </td>
</tr>
</table>
------解决方案--------------------请加上这个
document.getElementsByTagName( "div ")[0].className= 'a ';