zoukankan      html  css  js  c++  java
  • js---03属性操作

    <!DOCTYPE HTML>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>无标题文档</title>
    
    <script>
    window.onload = function (){
        var oBtn = document.getElementById('btn1');
        var oText = document.getElementById('text1');
        var oSelect = document.getElementById('select1');
    
        oBtn.onclick = function (){    
            alert(oText.value + ' 在 ' + oSelect.value);
        };
        oBtn1.onclick = function (){
            num -= 2;
            oP.style.fontSize = num + 'px';
            // oP.style.font-Size,JS 不允许出现"-"
            // padding-top        paddingTop
            // margin-left        marginLeft
        };
        oBtn3.onclick = function (){
            // oP.class = 'red';
            // class => className
            oP.className = 'red';
        };
        if( oImg.src == 'file:///C:/Users/Administrator/Desktop/11-4-JS1/img/1.jpg' ){
            oImg.src = 'img/2.jpg';
        }
    };
    </script>
    
    <script>
    var oInp = document.getElementById('inp1');
    
    oInp.onclick = function (){
        oInp.type = 'checkbox';
        // 咱们有仨位“祖宗”
        /*
            IE6 IE7 IE8 不支持
        */
    };
    /*
        oDiv.style.float = 'right';
        oDiv.style.styleFloat = 'right';        // IE
        oDiv.style.cssFloat = 'left';            // 非IE
        IE(styleFloat)
        非IE(cssFloat)
        <div class="right"></div>
    */
    </script>
    
    </head>
    
    <body>
    
    </body>
    </html>
  • 相关阅读:
    419. Battleships in a Board
    150. Evaluate Reverse Polish Notation
    153. Find Minimum in Rotated Sorted Array
    319. Bulb Switcher
    223. Rectangle Area
    iOS 常用到的宏#define
    VRAR 使用 SceneKit
    VR、AR、MR定义区别
    Swift 开源项目练习应用
    Swift3.0 UITextField
  • 原文地址:https://www.cnblogs.com/yaowen/p/6828746.html
Copyright © 2011-2022 走看看