HTML DOM method 屬性
定義和用法
method 屬性可設(shè)置或返回用于表單提交的 HTTP 方法。
語法
formObject.method=get|post
實(shí)例
下面的例子彈出的對(duì)話框中顯示了發(fā)送表單數(shù)據(jù)所使用的 HTTP 方法:
<html>
<head>
<script type="text/javascript">
function showMethod()
{
var x=document.getElementById("myForm")
alert(x.method
)
}
</script>
</head>
<body>
<form id="myForm" method="post">
Name: <input type="text" size="20" value="Mickey Mouse" />
<input type="button" onclick="showMethod()" value="Show method" />
</form>
</body>
</html>