<code class="html"><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></code>本实例中,我们创建了3个form表单,然后使用js的document.forms.length来获取表单个数,最后在控制台中输出这个值。最终输出结果为“there are 3 forms in this document”。
你可以把代码复制到这个页面运行一下。
主页面上引用了三个页面也说不过去呀。本次主要是把数据库合并了一下,至于功能,没有加什么新的东西,还是那些:在线订购、帐单查询(添加了一个打印的连接)、特价商品列表、热买商品列表、留言本(许多朋友说以前的那个有问题,现在换成枫叶阁女士留言本,挺不错的)、新闻、完善的管理
3
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号