网页不工作


Webpage not working

我在网页上添加了31个按钮,其中30个是"是"或"否"或"无线索",最后是"提交"。我使用jquery函数,使"NO"answers"NO线索"淡出点击"YES",反之亦然。但是,由于我的输入类型= "提交"为所有,我的jquery不工作,因为页面重新加载后,单击第一个按钮。对如何实现这一点有什么建议吗?

让你的"yes/no/no clue"按钮成为html按钮元素

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

尝试像这样改变按钮:

<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!">

按钮是页面上可以点击的元素,而提交输入元素类型将尝试将元素的值"提交"(或发送)回服务器。

如果"Yes", "No"answers"No Clue"按钮是submit类型,那么它们将提交表单并重新加载页面。尝试使用button类型。