关于触发事件

    <!--只能通过鼠标触发事件  -->
    <!--      <select onChange="alert('Change to page ' + this.value);">
        <option value="page1.html"></option>
        <option value="page1.html">Page 1</option>
        <option value="page2.html">Page 2</option>
    </select> -->

    <select id="theSelect">
        <!--  -->
        <option value="page1.html"></option>
        <option value="page1.html">Page 1</option>
        <option value="page2.html">Page 2</option>
    </select>
    <br>
    <input type="button" value="Click to change pages"
        onClick="alert('Change to page ' + document.getElementById('theSelect').value);">
    <!--  鼠标、键盘均可触发-->

 

posted @ 2016-04-17 13:06  绯乐  阅读(174)  评论(0编辑  收藏  举报