zoukankan      html  css  js  c++  java
  • javascript 学习记录

    select下拉选项框事件

    
    
    <select name="" id="input">
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
        <option value="4">4</option>
        <option value="5">5</option>
    </select>
    </body>
    <script>
        document.getElementById("input").addEventListener("focus",function () {
            console.log("focus");
        });
     
        document.getElementById("input").addEventListener("mousedown",function () {
            console.log("mousedown");
        });
     
        document.getElementById("input").addEventListener("mouseup",function () {
            console.log("mouseup");
        });
     
        document.getElementById("input").addEventListener("input",function () {
            console.log("input");
    		var x=document.getElementById("input")
      		alert("input"+x.options[x.selectedIndex].value);
        });
     
        document.getElementById("input").addEventListener("change",function () {
            console.log("change");
    		alert($('#input').val())
        });
     
        document.getElementById("input").addEventListener("blur",function () {
            console.log("blur");
        });
     
        document.getElementById("input").addEventListener("click",function () {
            console.log("click");
        });
     
        document.getElementById("input").addEventListener("keydown",function () {
            console.log("keydown");
        });
     
        document.getElementById("input").addEventListener("keyup",function () {
            console.log("keyup");
        });
     
        document.getElementById("input").addEventListener("select",function () {
            console.log("select");
        });
     
    
  • 相关阅读:
    java中获取类资源的不同姿势
    Jdk动态代理与Cglib动态代理
    Spring AOP
    Spring Ioc、DI
    windows 8.1 专业版 visual stuido 2015 安装失败
    win7 共享需要密码问题
    protobuffer .net 序列化
    【转载】SQL Server 2005数据库用户权限管理的设置
    【转载】mongoDB基本使用手册
    【转载】Thread.sleep(0)的意义
  • 原文地址:https://www.cnblogs.com/bestefforts/p/11465796.html
Copyright © 2011-2022 走看看