简体   繁体   English

网页无法正常运作

[英]Webpage not working

I have added 31 buttons on web page and 30 of them are either "Yes" or "No" or "NO Clue"and last is "Submit". 我在网页上添加了31个按钮,其中30个按钮是“是”或“否”或“否”,最后一个是“提交”。 I have used jquery functions such that "NO" and "NO Clue" fades out on clicking "YES" and viceversa. 我已经使用了jquery函数,以便在单击“是”时淡出“否”和“否提示”,反之亦然。 But since my input type = "submit" for all, my jquery is not working as the page reloads after clicking the very first button. 但是由于我的输入类型均为“ submit”,因此单击第一个按钮后页面重新加载时,我的jquery无法正常工作。 Any suggestions on how to implement this ? 关于如何实施此建议? I am a noob so please go easy on me. 我是菜鸟,所以请放轻松。

使您的“是/否/无提示”按钮html按钮元素

<button type="button">No</button>

Try changing the buttons like so: 尝试像这样更改按钮:

<button type="button">Yes</button>
<button type="button">No</button>
<button type="button">No Clue</button>
<!-- include the rest of the buttons here -->
<input type="submit" value="Submit!">

The buttons are elements on the page which can be clicked, whereas the submit input element type will try to 'submit' (or send) the values of elements back to the server. 按钮是页面上可以单击的元素,而Submit输入元素类型将尝试将元素的值“提交”(或发送)回服务器。

If the "Yes", "No" and "No Clue" buttons have a submit type then they will submit the form and the page would be reloaded. 如果“是”,“否”和“无提示”按钮具有submit类型,则他们将提交表单,页面将被重新加载。 Try using a button type for them. 尝试为他们使用button类型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM