js方法
<script type="text/javascript">
function Fox(){alert("Hello world!");}
</script>
在html中调用无反应。
<input type="button" name="Fox" onclick="Fox()" />
报错:对象不支持属性和方法。然后把属性name换个名称就OK了。第一次遇到这种事……jsjqueryjavascriptinput
<script type="text/javascript">
function Fox(){alert("Hello world!");}
</script>
在html中调用无反应。
<input type="button" name="Fox" onclick="Fox()" />
报错:对象不支持属性和方法。然后把属性name换个名称就OK了。第一次遇到这种事……jsjqueryjavascriptinput
请问你是在asp页面中测试的吗?
那段html代码应该放在form里面。你们可以在测试一下。
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
<script type="text/javascript">
<!--
function Fox(){alert("Hello world!");}
//-->
</script>
</head> <body>
<form method="post" action="">
<input type="button" name="Fox" onclick="Fox()" value="Click" />
</form>
</body>
</html>