HTML & CSS · Junior · Question 10 of 75

What is the default type of a <button> inside a <form>?

Explanation

By default a button inside a form has type="submit" and submits the form. It's a common source of bugs: a "Show password" button suddenly submits the form. Buttons that shouldn't submit need an explicit type="button".

Further reading

Problem with a question

HTML & CSS · Junior · question 10

Test yourself

Take the HTML & CSS · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz