zoukankan      html  css  js  c++  java
  • js

    <html><head lang="en">
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
    
      <!--<input value="222222" onclick="test1();" onselect="test2();">-->
    
    
    
      <!--<script>-->
           <!--// 网页或者图片被加载完毕时候调用-->
    <!--//      window.onload = function(){-->
    <!--//          alert(0);-->
    <!--//      };-->
    
           <!--var input = document.getElementsByTagName('input')[0];-->
           <!--function test1(){-->
              <!--// 去除外边框-->
              <!--input.style.outline = 'none';-->
              <!--// 改变宽度和高度-->
              <!--input.style.width = '550px';-->
              <!--input.style.height = '33px';-->
              <!--// 改变外边距-->
              <!--input.style.margin = '20px 0px 20px 0px';-->
           <!--}-->
    
            <!--function test2(){-->
               <!--alert(input.value);-->
            <!--}-->
    
      <!--</script>-->
    
    
    <!--第二种方式-->
        <input value="hello world!" style="outline: none;  550px; height: 33px; margin: 20px 0px;">
    
        <script>
            // 拿到标签
            var input = document.getElementsByTagName('input')[0];
            input.onclick = function(){
                // 去除外边框
                input.style.outline = 'none';
                // 改变宽度和高度
                input.style.width = '550px';
                input.style.height = '33px';
                // 改变外边距
                input.style.margin = '20px 0px 20px 0px';
            }
    
            input.onselect = function(){
                alert(input.value);
            }
        </script>
    
    </body></html>
  • 相关阅读:
    第十三周进度
    第十二周进度
    单词统计
    Vue——初级小项目(小清单)
    Vue——修饰符
    vue——表单输入绑定
    vue——计算属性和监听器
    vue——指令系统介绍
    面试笔试
    python之路——二分查找算法
  • 原文地址:https://www.cnblogs.com/yintingting/p/4624103.html
Copyright © 2011-2022 走看看