The form HTML element represents a user-submittable form.
HTML
<form attribute-name="attribute-value"></form>
Attributes
Name
Value
Description
accept-charset
character-encoding name list
Specifies the character encodings used for form submission
action
URI
Submission action for the form
autocomplete
on | off
Specifies whether the element represents an input control for which a UA is meant to store the value entered by the user (so that the UA can prefill the form later)
enctype
application/x-www-form-urlencoded | multipart/form-data | text/plain
MIME type with which a UA is meant to associate the form contents for form submission
method
get | post | put | delete
HTTP method with which a UA is meant to associate this element for form submission
name
string
Name part of the name/value pair associated with this element for the purposes of form submission
novalidate
novalidate | empty
Specifies that the element represents a form that is not meant to be validated during form submission
target
browsing-context name or keyword
browsing context or keyword that represents the target of the form
CSS
form {
display: block;
margin-top: 0em;
}
accept-charset
action
<!doctype html>
<html>
<body>
<form action="/">
<input type="text">
<input type="submit" value="Submit">
<input type="reset">
</form>
</body>
</html>
autocomplete
<!doctype html>
<html>
<body>
<form autocomplete="on">
<input type="text">
<input type="submit" value="Submit">
<input type="reset">
</form>
</body>
</html>
enctype
<!doctype html>
<html>
<body>
<form enctype="text/plain">
<input type="text">
<input type="submit" value="Submit">
<input type="reset">
</form>
</body>
</html>
method
<!doctype html>
<html>
<body>
<form method="post">
<input type="text">
<input type="submit" value="Submit">
<input type="reset">
</form>
</body>
</html>
name
<!doctype html>
<html>
<body>
<form name="myform">
<input type="text">
<input type="submit" value="Submit">
<input type="reset">
</form>
</body>
</html>
novalidate
<!doctype html>
<html>
<body>
<form novalidate="novalidate">
<input type="text">
<input type="submit" value="Submit">
<input type="reset">
</form>
</body>
</html>
target
<!doctype html>
<html>
<body>
<form action="/" target="_blank">
<input type="text">
<input type="submit" value="Submit">
<input type="reset">
</form>
</body>
</html>
CSS
<!doctype html>
<html>
<head>
<style>
form {
display: block;
margin-top: 0em;
}
</style>
</head>
<body>
<form>
<input type="text">
<input type="submit" value="Submit">
<input type="reset">
</form>
</body>
</html>