动态改变样式,如,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";
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";
相关文章推荐
- stylus动态改变样式
- [iOS开发]TextKit之动态改变样式
- 用C#代码动态改变页面样式
- Silverlight4 动态改变界面的样式
- JS实现动态改变对话窗口和图片样式的聊天;
- javascript实现css主题样式切换;动态改变引入的css文件;
- Ajax编程中,经常要能动态的改变界面元素的样式
- jQuery实现鼠标滚轮动态改变样式或效果
- [iOS开发]TextKit之动态改变样式
- 动态添加class名,改变标签样式(包含鼠标移入、移出及点击事件)
- 用C#代码动态改变页面样式
- 如何动态改变页面的样式(此类方法适用于页面中的其他,比如改变标题文字等)
- angular 创建一个简单的属性型指令 (动态获取DOM元素size,对DOM样式进行改变)
- ecshop foreach 循环内动态改变标签样式
- [VB.NET]vb.net 根据数据情况动态改变datagrid样式(急)
- 如何在网页中动态改变样式
- [微信小程序]js动态改变数组对象列表中的样式
- propertyGrid动态(runtime)改变item的readonly 和browsable
- 如何用jquery动态改变输入框的readonly属性
- 用C#代码动态改变页面样式