html form tag Make form for web page using html using form tag (<form>…</form>). We Make form for web page using html for ta...
html form tag
Make form for web page using html using form tag (<form>…</form>). We Make form for web page using html for taking different information from users. In a form we take information is many ways like text, checkbox, radio button etc.
Into the form tag we use input tag (<input>…</input>) which is the most important part in form making. Using type attribute with it different types of input ways are created.
Here is some attributes used into input tag.
text
Creates a field for a single line text input. It is written like
<input type ="text">.
Example
<!DOCTYPE html>
<html>
<head><title>Form making</title></head>
<body>
<form>
Please input your First name:<input type="text" name="firstname"><br>
Please input your Last name: <input type="text" name="lastname"><br>
Please input your Address: <input type="text" name="Address">
</form>
</body>
</html>
radio button
Creates a radio button which is used for choosing one option from many. It is written like <input type="radio">.
Example
<!DOCTYPE html>
<html>
<head><title>Form making</title></head>
<body>
<form>
Please input your First name:<input type="text" name="firstname"><br>
Please input your Last name: <input type="text" name="lastname"><br>
Please input your Address: <input type="text" name="address"><br>
<input type="radio" name="gender" value="male" checked> Male<br>
<input type="radio" name="gender" value="female"> Female<br>
<input type="radio" name="gender" value="not specified"> Not specified
</form>
</body>
</html>
submit button
Creates a button which plays role for submitting information. It is written like
<input type="submit">.
Example
<!DOCTYPE html>
<html>
<head><title>Form making</title></head>
<body>
<form>
Please input your First name:<input type="text" name="firstname"><br>
Please input your Last name: <input type="text" name="lastname"><br>
Please input your Address: <input type="text" name="address"><br>
<input type="radio" name="gender" value="male" checked> Male<br>
<input type="radio" name="gender" value="female"> Female<br>
<input type="radio" name="gender" value="not specified"> Not specified<br>
<input type="submit" value="Submit">
</form>
</body>
</html>




No comments