zoukankan      html  css  js  c++  java
  • javaScript实现修改输入框之后标红

    <html>
     <title>实现标红</title>
     <script type="text/javascript">
      function edit_save(value1){
        for(var i=1;i<4;i++){
         if(value1==1)
           document.getElementById('input'+i).disabled="";
         else
           document.getElementById('input'+i).disabled="none";
        }
       } 
       function blurTest(inputTag,value1){
        var newValue = document.getElementById(inputTag).value;
        if(value1!=newValue){
          document.getElementById(inputTag).style.color = '#ff0000';
         }else{
          document.getElementById(inputTag).style.color = '#000000';
         }
       }
     </script>
     <body>
      <table border='0' width = "800" align="center">
       <tr>
        <td><input id="input1" type="text" value="A" disabled="true" onblur="blurTest('input1','A')" ></input><td>
        <td><input id="input2" type="text" value="B" disabled="true" onblur="blurTest('input2','B')" ></input><td>
        <td><input id="input3" type="text" value="C" disabled="true" onblur="blurTest('input3','C')" ></input><td>
        <td><input type="button" onclick="edit_save('1')" value="编辑"></td>
         <td><input type="button" onclick="edit_save('2')" value="保存"></td>
       </tr>
      <table>
     </body>
    </html>

  • 相关阅读:
    股票投资
    知道复利终值求本金
    复利计算和单利计算
    实验0:了解和熟悉操作系统
    0909我的编译原理感
    递归下降分析法
    有(很)穷的自动机
    评论
    C语言文法阅读与理解序
    C语言文法阅读与理解
  • 原文地址:https://www.cnblogs.com/xiayahui/p/5013614.html
Copyright © 2011-2022 走看看