<script type="text/JavaScript>
function changeLink()
{
document.getElementById("node").innerHTML="搜狐";
}
function showAllInput()
{
var aInput=document.getElementsByTagName("input");
var sStr="";
for(var i=0;i<aInput.length;i++)
{
sStr+=aInput[i].value+"<br />";
}
document.getElementById("s").innerHTML=sStr;
}
function showOneInput()
{
var aInput=document.getElementsByName("season");
var sStr="";
for(var i=0;i<aInput.length;i++)
{
sStr+=aInput[i].value+"<br />";
}
document.getElementById("s").innerHTML=sStr;
} </script>
</head>
<body> <div id="node">新浪</div> <input name="b1" type="button" value="改变层内容" onclick="changeLink();" /><br /> <br /><input name="season" type="text" value="春" /> <input name="season" type="text" value="夏" /> <input name="season" type="text" value="秋" /> <input name="season" type="text" value="冬" /> <br /><input name="b2" type="button" value="显示input内容" onclick="showAllInput()" /> <input name="b3" type="button" value="显示season内容" onclick="showOneInput()" /> <p id="s"></p> </body>