You are calling hide()
when you click a submit button inside a form.
- The JavaScript runs
- The element is hidden
- The form submits
- A new document is loaded and rendered (and it isn't hidden in the new document).
Don't use a submit button unless you actually want to submit the form.
<button type="button" ...>
If you do want to submit the form then you'll need to set the hidden
attribute in the new page. You could do that with server-side code that reads the form data (and you'll need to set a name and value for the hide
submit button so the data can be picked up by that page).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…