国产chinesehdxxxx野外,国产av无码专区亚洲av琪琪,播放男人添女人下边视频,成人国产精品一区二区免费看,chinese丰满人妻videos

App下載
首頁(yè)javascriptformJavascript Form - 如何獲取在當(dāng)前頁(yè)面中使用表單長(zhǎng)度屬性創(chuàng)建的表單元素的數(shù)量

Javascript Form - 如何獲取在當(dāng)前頁(yè)面中使用表單長(zhǎng)度屬性創(chuàng)建的表單元素的數(shù)量

我們想知道如何獲取在當(dāng)前頁(yè)面中使用表單長(zhǎng)度屬性創(chuàng)建的表單元素的數(shù)量。


<html>
<body>
<form name="form1" method="post" action="">
    <input type="text" name="textfield">
</form>
<form name="form2" method="post" action="">
    <input type="button" value="Only a sample button" onclick="return false"> 
</form>
<form name="form3" method="post" action="">
    <input type="checkbox" name="checkbox" value="checkbox">
</form>
<button onclick="function1()">Click here</button>
<script language="JavaScript">
function function1() {
    var m = document.forms.length;
    console.log("There are "+m+" forms in this document") 
} 
</script>
</body>
</html>