日期:2014-05-16  浏览次数:20436 次

高手帮忙看个JS的问题
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script type="text/javascript">
function changeitem(){ 
  s="1,fgdfg";
var s= new array();
s=s.split(",");
document.getElementById("aa").value=s[0];
document.getElementById("bb").value=s[1];
}
</script>
</head>
<body>
<input type="text" name="aa" id="aa" />  
<input type="text" name="bb" id="bb" />
<input type="button" name="button1" value="提交" onclick="changeitem()"/>
</body>
</html>


这样写错了吗?为什么没有运行结果,

------解决方案--------------------
//var s= new array(); 这句不要