Events handling
Events allow you to add the real interaction on your web page. JavaScript allows you to attach event handlers on your HTML pages and execute custom code when they are triggered. For example, the given code will display an alert when the user clicks on your web page body:
document.querySelector('body').onclick = function() {
alert('You clicked the page body!!!');
}
推薦閱讀
- 通信網絡基礎與設備
- 社交網絡對齊
- 智慧城市:大數據、互聯網時代的城市治理(第4版)
- Building E-commerce Sites with VirtueMart Cookbook
- Twilio Cookbook
- 物聯網識別技術
- 網絡故障現場處理實踐(第4版)
- Hands-On Chatbot Development with Alexa Skills and Amazon Lex
- Building RESTful Web Services with Spring 5(Second Edition)
- 大話社交網絡
- 網管工具使用與技巧大全
- AIoT應用開發與實踐
- 異構蜂窩網絡關鍵理論與技術
- 深入理解計算機網絡
- 智慧城市中的物聯網技術