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>

  • 相关阅读:
    BZOJ2988 : DIVISORS
    BZOJ1255 : Pku2332 One is good, but two is better
    BZOJ2411 : 黄牌
    BZOJ2887 : 旅行
    BZOJ2353 : 矩形压缩
    BZOJ2997 : 想法计数
    BZOJ2092 : [Poi2010]Lamp
    Potyczki Algorythmiczne 2019
    2019-2020 ICPC Asia Hong Kong Regional Contest
    The 2019 China Collegiate Programming Contest Harbin Site
  • 原文地址:https://www.cnblogs.com/xiayahui/p/5013614.html
Copyright © 2011-2022 走看看