Lab 07 HTML Radio & Check BIW 10103 INTRO TO WEB TECHNOLOGY
CINDY BEH XIN YI
AI200259
Lab 07
HTML Radio & Check
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, text area 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.
<input type="radio">
-
This button
normally presented in a collection of radio buttons describing a set of
related options.
-
Only one radio
button in a group can be selected at the same time.
name
-
This attribute
must use the name in same group.
value
-
This attribute
defines the unique value associated with each radio button.
<input type= “checkbox”>
-
This element
defines a checkbox which shown as a square box that is ticked (checked) when
activated.
-
This allows users
to choose one or more options at the same time.
2. Write a HTML code to display the output as show as Figure Q2 on the webpage.
<!DOCTYPE
html>
<html>
<body>
<h2> LAB-07
21-4-2020 </h2>
<h3> Exercise
</h3>
<input
type="checkbox" name="v1" value="car">
Car<br>
<input
type="radio" name="colour" value="black">
Black
<input
type="radio" name="colour" value="white">
White
<input
type="radio" name="colour" value="green">
Green
<input
type="radio" name="colour" value="red" >
Red<br>
<input
type="checkbox" name="v2" value="home"> Home
<br>
<input
type="radio" name="size" value="small"> Small
<input
type="radio" name="size" value="large"
checked> Large
</body>
</html>
3. Make a report and
submit it to the Author.
4. Put your report
and answer to your blog also.


Comments
Post a Comment