主题:菜鸟的一个简单问题
<!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>
</head>
<body>
<script language="javascript">
function action(para){
document.write("jww");
}
</script>
<script language="javascript">
//action(1);
</script>
<form id="form1" name="form1" method="post" action="">
<select name="select" onchange="action(1)">
<option>jww</option>
<option>jw2w</option>
</select>
</form>
<% out.println("jwwww");%>
</body>
</html>
为什么上述代码在下拉列表change的时候不会执行action()函数?
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<script language="javascript">
function action(para){
document.write("jww");
}
</script>
<script language="javascript">
//action(1);
</script>
<form id="form1" name="form1" method="post" action="">
<select name="select" onchange="action(1)">
<option>jww</option>
<option>jw2w</option>
</select>
</form>
<% out.println("jwwww");%>
</body>
</html>
为什么上述代码在下拉列表change的时候不会执行action()函数?