πŸš§πŸ—οΈπŸ‘·πŸΎNote: This site is under construction. Expect a lot of broken links and layouts. Have feedback? Email me at [email protected]

Home β†’ Farai's Codelab

How to prevent buttons from causing a form to submit with HTML

Published:

A while back, though, my friend Eric Bailey taught me a much simpler way to handle this: add type="button" to the button.

Much better than e.preventDefault.