javascript 验证表单没反应,详细看代码,就是不执行javascript函数

2024-12-23 13:18:01
推荐回答(5个)
回答1:

你这段HTML代码有点问题
1: 标签应该写在<head>的第一个子节点,也就是<script>的前面<br>2:<script>的type值写错了,应该是<script language="javascript"> 或者直接写<script><br>3:<form>标签应该写在<body>内部。<br><br>希望能帮到你。</p> </div> </div> <div class="clear"></div> </div> <div class="wdhdnr"> <div class="huidanrtop"> <div class="wdhuidaxinx"> <div class="wdhuidaxm">回答2:</div> </div> </div> <div class="clear"></div> <div class="wdhuidanrmid"> <div class="zuijiacont"> <p><form name="form_addMessage" id="form_addMessage" method="post" onsubmit="return chk();" > 中的onsubmit="return chk();"去掉<br><input type="submit" name="btnTiJiao" value="送祝福给你们" />变为<br><br><input type="submit" name="btnTiJiao" value="送祝福给你们" onclick="chk();" /></p> </div> </div> <div class="clear"></div> </div> <div class="wdhdnr"> <div class="huidanrtop"> <div class="wdhuidaxinx"> <div class="wdhuidaxm">回答3:</div> </div> </div> <div class="clear"></div> <div class="wdhuidanrmid"> <div class="zuijiacont"> <p>正确的写法是<br><script type="text/javascript"><br> <br>用下面的写法也是ok的,但是language这个属性在W3C的HTML标准中,已不再推荐使用,推荐使用type<br><script language="javascript"></p> </div> </div> <div class="clear"></div> </div> <div class="wdhdnr"> <div class="huidanrtop"> <div class="wdhuidaxinx"> <div class="wdhuidaxm">回答4:</div> </div> </div> <div class="clear"></div> <div class="wdhuidanrmid"> <div class="zuijiacont"> <p><script type="javascript"><br><br>改为<br><script></p> </div> </div> <div class="clear"></div> </div> <div class="wdhdnr"> <div class="huidanrtop"> <div class="wdhuidaxinx"> <div class="wdhuidaxm">回答5:</div> </div> </div> <div class="clear"></div> <div class="wdhuidanrmid"> <div class="zuijiacont"> <p><script type="javascript"><br>改为<br><script language="javascript"><br>或者干脆是<br><script></p> </div> </div> <div class="clear"></div> </div> </div> </div> <div class="wendaright"> <div class="wdluluerwema"> <div class="wdxgwttop">相关问答</div> <div class="wdxgwtnr"> </div> <div class="clear"></div> </div> <!-- 其他随机问答['id'=>alphaID($like['zid'])] --> <div class="wdluluerwema"> <div class="wdxgwttop">最新问答</div> <div class="wdxgwtnr"> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.51a.net/349709745.html">求推荐一本学习Matlab的好书,比较全面的那种,适合深入学习,不要入门级的那种。</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.51a.net/481471204.html">在EVE里,把一个本来没有任何工业等级的星系,刷到四级工业等级,需要多长时间左右?</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.51a.net/477077076.html">急想知道从汕头火车站到潮阳客运站要多久!!!</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.51a.net/323373672.html">你好,我想再淘宝上开店,在那填写店铺信息那里,有一项是写图片的网址,还有店铺的链接网址要怎么填呢?</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.51a.net/1435757379503503459.html">名词解释: 无为:</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.51a.net/2143220970172592788.html">在1---1000的数字中,个位和十位数字相同的数有几个?</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.51a.net/444293592.html">我报了广警专科,511分(3A是445分)。想问一下下下。。。</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.51a.net/321009989.html">坦克世界地图加载慢怎么办?</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.51a.net/594871746.html">我的搜狗浏览器经常出现这个图片,请问我的浏览器出现什么问题呢?该怎么解决?</a></div> </div> <div class="wdxgwtcont"> <div class="wdxgtitle"><a href="https://www.51a.net/100963043.html">冰箱R12可以用134A吗用换冷冻油和干燥剂吗</a></div> </div> </div> </div> </div> <div class="clear"></div> <div class="footer"> <!-- 移动底部导航 --> <div class="fanhuitop"><a href="#top" ref="nofollow"><img src="https://www.51a.net/static/old/img/fhtop.png" alt="返回顶部" title="返回顶部"></a></div> <div class="dibu"> <div class="dibu"> </div> </div> <div class="banquan"> <p>内容全部来源于网络收集,如有侵权,请联系网站删除:QQ:24596024</p> </div> </div> </div> </div> <script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?aa60e2f779ee696abd6a207eac06903d"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script> </body> </html>