HTML CSS examples for HTML Tag:button
The form attribute sets one or more forms the button belongs to.
Value | Description |
---|---|
form_id | Specifies the form element the <button> element belongs to. |
The value of this attribute must be the id attribute of a <form> element in the same document.
A button is located outside a form but it is still a part of the form.
<!DOCTYPE html> <html> <body> <form id='my' action="/action_page.php" method="get"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br> <button type="submit" formtarget="_blank">Submit to a new window/tab</button> </form><!-- w w w . jav a 2s. com--> <button form='my' type="submit">Submit</button> </body> </html>