为什么document.getElementByTagName没法获取input属性
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>window对象</title>
<script type="text/javascript">
var button=document.getElementsByTagName("input")[0];
button.onclick=function (){
window.open("http://www.baidu.com","_black","height=400px width=600px ")
};
</script>
</head>
<body>
<form>
<input type="button" value="点击我,打开新窗口" />
</form>
</body>
</html>