<form>
<!-- ...form contents... -->
<button type="submit" formaction="https://www.PuStudy.Com/resources/html-forms-action.html" formtarget="_blank">
Submit
</button>
</form>
In the above example we add the formtarget
attribute to a button control.
formtarget
AttributeThe formtarget
attribute allows you to specify the browsing context to load the destination indicated in the action
attribute.
Possible values:
_blank
_self
_top
_parent
U+005F LOW LINE
character.The above values have different meanings based on whether the page is sandboxed or not. See the W3C website for more information on these values and their implications.
<button>
ElementThe <button>
element creates a button control in an HTML document.
Any contents of the <button>
element appears on the button.
The <button>
element can be associated with a form or stand alone by itself (in such case it could have JavaScript attached via the onclick
attribute) to make the button actually do something.