HTML CSS examples for HTML Tag:form
You can associate elements with forms anywhere in the document.
To associate an element with a form, set the form attribute to the id value of the form.
Using the form Attribute
<!DOCTYPE html> <html> <head> <title>Example</title> </head> <body> <form id="voteform" method="post" action="http://example.com/form"> <p> <label for="fave"> Fruit: <!-- w w w .j ava2 s . co m--> <input autofocus id="fave" name="fave"> </label> </p> </form> <p> <label for="name"> Name: <input form="voteform" id="name" name="name"> </label> </p> <button form="voteform" type="submit">Submit Vote</button> <button form="voteform" type="reset">Reset</button> </body> </html>