<form id="myForm" action="https://www.PuStudy.Com/resources/html-forms-action.html"> <!-- ...form contents... --> </form> <button form="myForm"> Submit Form </button>
In the above example we add the
form attribute to a button control. We also add the actual
<form> element that the button is using.
form attribute allows you to specify the ID of a form to which this control belongs. This allows you to use the
<button> element without having to nest it within
If this attribute is used, its value must be the ID of a form element in the element's owner.
<button> element creates a button control in an HTML document.
Any contents of the
<button> element appears on the button.