HTML form tag and element
1. HTML form element is used to represent a form in an HTML page.
2. Forms are used to collect data supplied by users in an HTML document.
Syntax
<form> </from>
Category
HTML form element belongs to HTML forms.
Whether both start and end tags are required
Yes.
Can contain
HTML form element can contain inline elements and other block level elements.
Can reside within
HTML form element can reside within APPLET, BLOCKQUOTE, BODY, CENTER, DD, DEL, DIV, FIELDSET, IFRAME, INS, LI, MAP, NOFRAMES, NOSCRIPT, OBJECT, TD, TH.
Attributes
Attributes specific to this element
action, method, enctype, accept-charset, accept, name.
Identifiers
language information and text direction
Title
Style
Target frame information
Events
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout onkeypress, onkeydown, onkeyup.
Supported doctypes
HTML 4.01 strict, HTML 4.01 transitional, HTML 4.01 frameset.
Example of using HTML form element
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>HTML form tag example - HTML tutorial | w3resource</title>
</head>
<body>
<form name="example_ form" action="html-form-tag-example.html" >
Name: <input type="text" size="30" /><br /><br />
Email: <input type="text" size="30" /><br /><br />
Place: <input type="text" size="10" /><br /><br />
<input type="submit" value="Submit" / >
</form>
</body>
</html>
Result
View this example in a separate browser window
Previous: HTML iframe tag and element
Next: HTML input tag and element
Test your Programming skills with w3resource's quiz.
- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join