JAVAscript學習筆記 js事件 第一節 (原創) 參考js使用表

來源:互聯網
上載者:User

標籤:over   title   var   htm   this   focus   button   執行   alert   

<!DOCTYPE html><html lang="en" onUnload="ud()"><head>    <meta charset="UTF-8">    <title>Title</title>    <script>        function demo() {            alert("hello");        }        function onOver(ooj) {            ooj.innerHTML = "滑鼠移入顯示";        }        function onOut(ooj) {            ooj.innerHTML = "滑鼠移出顯示";        }        function changeDemo(bg) {            alert("內容改變了啊")        }        function changeDemo1(bg) {            bg.style.background = "red";        }        function changeDemo2(bg) {            bg.style.background = "blue";        }        function mgs() {            alert("內容載入完畢")        }        function bu(bg) {            var b = bg.value;            alert("滑鼠移開事件(您輸入的是)" + b);        }        function ud() {            alert("您關閉了網頁")        }    </script>    <style>        .div {            width: 100px;            height: 100px;            background-color: cadetblue;        }    </style></head><body onload="mgs()" onunload="ud()"><!--網頁載入完畢事件,網頁關閉事件(關閉後執行看不見)--><button onclick="demo()">按鈕</button><!--單機事件--><div class="div" onmouseout="onOut(this)" onmouseover="onOver(this)">開始顯示</div><form>    <input type="text" onchange="changeDemo(this)"/>    <!--常值內容改變事件-->    <input type="text" onselect="changeDemo1(this)" onfocus="changeDemo2(this)"/>    <!--常值內容選中事件--> <!--滑鼠聚集(選中)事件-->    <input type="text" onblur="bu(this)"/>    <!--移開游標事件事件--></form></body></html>

 

JAVAscript學習筆記 js事件 第一節 (原創) 參考js使用表

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.