几年没写js,调用都忘记了,记一下,备忘
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>js调用html代码</title>
</head>
<body>
<input type='button' value='click' id='btnID'/>
<script>
document.getElementById('btnID').onclick = function() {
alert('success!');
}
</script>
</body>
</html>






网友评论