<html>
<head>
<meta charset="utf-8">
<title>点击按钮弹出窗口</title>
<style>
input{
width:50px;
height:30px;
}
</style>
</head>
<body>
<input type="button" value="按钮" id="OK">
<script>
var ok=document.getElementById("OK");
ok.onclick=function(){
alert("你好");
};
</script>
</body>
</html>