• 49.按钮只能单击一次,鼠标事件


     1 <!DOCTYPE html>
     2 <html>
     3 <head lang="en">
     4     <meta charset="UTF-8">
     5     <title></title>
     6     <style>
     7         .over {
     8             color: yellow;
     9             background: #7a7280;
    10         }
    11 
    12         .down {
    13             color: yellow;
    14             background: #7a7280;
    15             font-style: italic;
    16         }
    17     </style>
    18 </head>
    19 <body>
    20 <!--1.鼠标移入移出事件-->
    21 <input type="button"
    22        onmousemove="this.className='over';"
    23        onmouseout="this.className='';"
    24        onmousedown="this.className='down';"
    25        onmouseup="this.className='over';"
    26        value="让按钮嵌入"
    27        onclick="this.value='嵌入成功!'"
    28 
    29         />
    30 
    31 
    32 <!--2.按钮只能单击一次-->
    33 <button onclick="this.disabled=true">单击</button>
    34 
    35 
    36 </body>
    37 </html>
    View Code
    <!DOCTYPE html>
    <html>
    <head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <style>
    .over {
    color: yellow;
    background: #7a7280;
    }

    .down {
    color: yellow;
    background: #7a7280;
    font-style: italic;
    }
    </style>
    </head>
    <body>
    <!--1.鼠标移入移出事件-->
    <input type="button"
    onmousemove="this.className='over';"
    onmouseout="this.className='';"
    onmousedown="this.className='down';"
    onmouseup="this.className='over';"
    value="让按钮嵌入"
    onclick="this.value='嵌入成功!'"

    />


    <!--2.按钮只能单击一次-->
    <button onclick="this.disabled=true">单击</button>


    </body>
    </html>
  • 相关阅读:
    JS高级——eval
    JS高级——Object.prototype成员
    JS高级——原型链
    JS高级——逻辑中断
    移动web——bootstrap媒体对象
    移动web——bootstrap如何修改原组件
    移动web——bootstrap响应式轮播图
    Leetcode题解
    位运算实现四则运算(C++实现)
    扫码登陆原理
  • 原文地址:https://www.cnblogs.com/mx2036/p/7099092.html
Copyright © 2020-2023  润新知