javascript onClict事件
onclict事件 为点击事件
多用于按钮点击后的操作
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script type="text/javascript"> window.onload = function (){ //获取获取标签对象 var btn = document.getElementById("btn01"); btn.onclick = function (){ alert("动态注册点击按钮") } } </script> </head> <body> <button id = "btn01">按钮</button> </body> </html>