简体   繁体   中英

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". I have used jquery functions such that "NO" and "NO Clue" fades out on clicking "YES" and viceversa. But since my input type = "submit" for all, my jquery is not working as the page reloads after clicking the very first button. 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.

If the "Yes", "No" and "No Clue" buttons have a submit type then they will submit the form and the page would be reloaded. Try using a button type for them.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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