LAB 7
Lab #
HTML Radio & check
INFORMATION
HTML Forms
HTML Forms are required, when you want to collect some data from the
site visitor. For example, during
user registration you would like to collect information such as name, email address, credit card, etc.
There are various form elements available like text fields, textarea fields, drop-down menus, radio buttons,
checkboxes, etc.
The HTML <form>
tag is used to create an
HTML form and it has following syntax
–
INSTRUCTION
1. By using
Notepad, type the following text:
<!DOCTYPE html>
<html>
<body>
<h2> LAB-07
21-4-2020 </h2>
<h3> Example1
: Radio Button Input </h3>
<input type="radio" name="gender" value="male" checked> Male<br>
<input type="radio" name="gender" value="female"> Female<br>
<h3> Example2
:Input Type Checkbox
</h3>
<input type="checkbox" name="v1" value="Bike"> I have a
bike<br>
<input type="checkbox" name="v2" value="Car"> I have
a car <br>
</body>
</html>
2. Save the file as Lab_07.html.
3. Upload your work into the blog.
QUESTIONS
1.
Explain about
the HTML code above.
<!DOCTYPE html>
declaration for a HTML document
<html> root
element of an HTML page
<head> element
that contains meta information of the HTML page
<body>
element that declared the document’s body
<h2> &
<h3> element that declares headings
<input type=”radio”>
element that define as a radio buttons
< input type=”checkbox”>
element that define as a checkbox
<br> element
that define as break line
2.
Write a HTML code to display the output as show as Figure Q2 on the webpage.
Figure Q2
<!DOCTYPE
html>
<html>
<body>
<h1> LAB-07 21-4-2020 </h1>
<h2> Exercise </h2>
<input type="checkbox"
name="v1" value="car"> <b>Car</b> <br>
<input type="radio"
name="color" value="black"> <b>Black</b>
<input type="radio"
name="color" value="white"> <b>White</b>
<input type="radio"
name="color" value="green"> <b>Green</b>
<input type="radio"
name="color" value="red"> <b>Red</b>
<br>
<input type="checkbox"
name="v2" value="home"> <b>Home</b>
<br>
<input type="radio"
name="size" value="small"> <b>Small</b>
<input type="radio"
name="size" value="large"> <b>Large</b>
</body>
</html>
Output:


Comments
Post a Comment