您的位置:首页 > Web前端 > CSS

动态改变样式,如,readOnly, display

2008-10-21 15:26 253 查看
1.

readOnly =true/ false , 是html中的感念。切记在脚本中readOnly的O一定要大写 ,恢复只用把该属性设置为 false。

display, CSS中的display的默认值是"inline"。style="display:"";" // 正常显示对象,与未加display一样。

// 增加HTML属性。

<input name="charge_3" type="text" size="12" value="<%=typeAndFieldOther.getLoginCharge() %>"

document.getElementById("charge_3").setAttribute("readOnly","true");

// 更改样式

<input id="colseWindow" name="colseWindow" type="button" class="buttons2" style = "position:relative;left:0px;" value="关闭窗口" onClick="window.close()" class="buttons2" >

document.getElementById("colseWindow").style.position = "absolute";
document.getElementById("colseWindow").style.left = "350px";
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: