易截截图软件、单文件、免安装、纯绿色、仅160KB

通过JavaScript将输入框设置为只读

注意:readOnly中的O要大写
//页面初始化录入,判断指标说明是否为工资性支出。
  function init() {
   var mark = "<%=mark%>";
   //如果指标说明为“工资性支出”,则工资支出那一项变为只读,且值为“指标可用金额”;其他录入框都不可录入。
   if(mark!="" && mark=="工资性支出") {
    document.getElementById("money0").readOnly = "true";
    document.getElementById("money1").readOnly = "true";
    document.getElementById("money3").readOnly = "true";
    document.getElementById("forwhat0").readOnly = "true";
    document.getElementById("forwhat1").readOnly = "true";
    document.getElementById("forwhat3").readOnly = "true";
    document.getElementById('money2').value = <%=budgetMoney[2]%>;
    document.getElementById('money2').readOnly = "true";
   } else {
   //如果指标说明不为“工资性支出”,则工资支出那一项不可录入。
    document.getElementById('money2').readOnly = "true";
    document.getElementById('forwhat2').readOnly = "true";
   }
  }


相关文档:

JavaScript 获取对象的高度和宽度详细说明

scrollHeight: 获取对象的滚动高度。
scrollLeft:设置或获取位于对象左边界和窗口中目前可见内容的最左端之间的距离
scrollTop:设置或获取位于对象最顶端和窗口中可见内容的最顶端之间的距离
scrollWidth:获取对象的滚动宽度
offsetHeight:获取对象相对于版面或由父坐标 offsetParent 属性指定的父坐标的高度
offsetL ......

Javascript中最常用的55个经典技巧

1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)> <td>no </table> 可用于Table
2. <body onselectstart="return false"> 取消选取、防止复制
3. onpaste="return false" 不准粘贴
4. oncopy ......

理解Javascript闭包(closure)

理解Javascript闭包(closure)
专题 原帖 http://www.w3cgroup.com/article.asp?id=87
此文用通俗的文字介绍了Javascript闭包 。
看过后,我对javascript闭包简单的理解就是 文中第四、五段中所说的“在内存中维持一个变量,不会被GC回收”。
当然还需要学习才能深入的理解javascript闭包
一、什么是闭包? ......

javascript 中常用的55个经典技巧

1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)> <td>no </table> 可用于Table
2. <body onselectstart="return false"> 取消选取、防止复制
3. onpaste="return false" 不准粘贴
4. oncopy="return false;" oncut="re ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号