Professional Documents
Culture Documents
HTML Iii
HTML Iii
Question 1
Which of the following is/are not valid tag(s) for inserting audio files in an HTML page ?
1. embed
2. audio
3. sound
4. music
Answer
sound, music
Reason — <EMBED> and <AUDIO> tags are used to insert audio files in an HTML page. sound and music
are not valid tags.
Question 2
Which of the following is/are not valid tag(s) for inserting video files in an HTML pages?
1. embed
2. video
3. movie
4. VID
Answer
movie, VID
Reason — <EMBED> and <VIDEO> tags are used to insert video files in an HTML document. movie and
VID are not valid tags.
Question 3
Answer
Linking via <A>
Embedding via <EMBED>
Reason — We can link an audio file via anchor tag <A> in the following way :
<A HREF = "audio.mp3"> Click to Play </A>
We can link an audio file via embed tag <EMBED> in the following way :
<EMBED SRC = "audio.mp3" WIDTH = "100" HEIGHT = "50" AUTOSTART = "TRUE" LOOP =
"TRUE">
<VIDEO> tag is used to insert a video file in HTML page.
Question 4
Answer
All of these
Reason — We can add a video file in a web page using different tags in the following ways:
Question 5
Any tag allowed inside a <body> tag is allowed inside a <form> tag.
1. True
2. False
Answer
True
Reason — Any tag allowed inside a <body> tag is allowed inside a <form> tag to render the form in a
presentable way.
Question 6
Reason — The <FORM> tag always takes two attributes — ACTION and METHOD.
ACTION attribute specifies any script URL that will receive uploaded data and METHOD specifies the
method which will be used to upload data.
Question 7
The <input> tag has several kinds of controls which are dictated by the ............... attribute.
1. SRC
2. value
3. name
4. type
Answer
type
Reason — The <input> tag has several kinds of controls which are dictated by the TYPE attribute. It
indicates the type of input control we want to create. This element is used to create other form controls
such as radio buttons and checkboxes.
Question 8
1. limit
2. size
3. value
4. maxlength
Answer
size
Reason — It is possible to set the width of a text by specifying a SIZE attribute. SIZE attribute specifies
the width of the text input control in terms of characters.
Question 9
Which of the following tags will clear the contents of the form?
Answer
Question 10
x Male
x Female
Now choose the correct line of code for the above :
1.
2.
3.
4.
Question 11
A developer can restrict the values accepted in a text field by specifying a ............... attribute.
1. size
2. maxlength
3. value
4. You cannot restrict text values using HTML
Answer
maxlength
Reason — A developer can restrict the values accepted in a text field by specifying
a maxlength attribute. It specifies the maximum number of characters a user can enter into the text box.
Question 12
You can mask the input typed into a text field by specifying an <input> tag as ............... .
1. password
2. secure
3. invisible
4. hidden
Answer
password
Reason — You can mask the input typed into a text field by specifying an <input> tag as password. It
hides the characters input in the box and shows dots or asterisk in place of every character.
Question 13
1. <password>
2. <input>
3. <pwd>
4. <pword>
Answer
<input>
Reason — The password boxes are created using an <INPUT> element whose TYPE attribute has a
value of "password". An example is as follows:
<INPUT TYPE = "PASSWORD" NAME = "PWD" />
Question 14
HTML provides an attribute for the <input> tag that allows you to hide data with some designated
character to make it secure.
1. True
2. False
Answer
True
Reason — We can mask the input typed into a text field by specifying an <input> tag as password. It
hides the characters input in the box and shows asterisk in place of every character. Consider the
following example,
<INPUT TYPE = "PASSWORD" NAME = "PWD" />
Question 15
Which of the following tag is used to define options in a drop-down selection list ?
1. <select>
2. <list>
3. <dropdown>
4. <option>
Answer
<option>
Reason — A drop down selection list is created with SELECT and OPTION tag pair. An example is
given below:
Question 16
1. checkbox
2. optionbox
3. radio button
4. drop down list
Answer
radio button
Reason — Radio buttons are used when only one option is required to be selected. All of its options are
mutually exclusive.
Question 17
1. select
2. choice
3. checked
4. marked
Answer
checked
Reason — You can pre-select a radio button by utilizing a checked attribute. It indicates that a
particular option should be selected by default when a page loads.
Question 18
If you want to display a list of 200 countries which control should you use:
1. radio button
2. checkbox
3. select list
4. slide widget
Answer
select list
Reason — A select list is used when we have many options available to be selected but only one or two
options will be selected. We can have a select list of 200 countries out of which a country can be
selected.
Theoretical Questions
Question 1
Answer
Some popular audio formats are mp3, wav, midi, m4a and ogg/oga.
Some popular video formats are asf, avi, mpeg, QuickTime and RealVideo.
Question 2
Name the tags that can be used to insert audio and video files in a webpage.
Answer
Question 3
What character is displayed on the password forms when the user inputs characters ?
1. a random character.
2. a '+' character.
3. an asterisk
4. a dot
Answer
an asterisk
Reason — We can mask the input typed into a text field by specifying an <input> tag as password. It
hides the characters input in the box and shows asterisk in place of every character.
Question 4
1. radiobutton
2. radiob
3. radio
4. optionbutton
Answer
radio
<form>
...
<input type = "radio" name = "Gender" value = "male"> Male <br>
<input type = "radio" name = "Gender" value = "female"> Female
<br>
...
</form>
The TYPE attribute is set to "radio".
Question 5
1. just name
2. name, columns and rows
3. name and rows
4. columns and rows
Answer
Reason — NAME, COLS and ROWS are the valid attributes which specify the name of the control, the
number of columns and the number of rows of text area box, respectively.
Question 6
What attributes can be used with the SELECT form ?
Answer
Reason — NAME, SIZE and MULTIPLE attributes can be used with the SELECT form which specify
the name of the control, present a scrolling list box and allow the user to select multiple items from the
menu, respectively.
Question 7
1. Yes
2. No
Answer
No
Reason — No, the SIZE attribute is not valid for the SUBMIT button.
Question 8
1. Id and action
2. Class and method
3. Action and method
4. method and id
Answer
Reason — The two most important attributes of a form are ACTION and METHOD.
ACTION attribute specifies any URL script which will receive uploaded data and METHOD specifies
the method which will be used to upload data.
Question 9
1. type
2. id
3. name
4. size
Answer
id
Reason — The for attribute of a <label> tag should match the id attribute of the corresponding input
element. The for attribute is used to associate a label with a form control, providing a textual
description or caption for the input field.
Question 10
1. Type="text"
2. Type="hidden"
3. Type="password"
4. Type="null"
Answer
Type="password"
Reason — We can mask the input typed into a text field by specifying an <input> tag as password. It
hides the characters input in the box and shows asterisk in place of every character.
Question 11
1. True
2. False
Answer
False
Reason — The method attribute will not always "post" data into the browser. The method attribute can
be set to "GET" or "POST" to determine how the data is sent to the server.
Question 12
Checkbox buttons let users select one or more of a particular set of choices.
1. True
2. False
Answer
True
Reason — Checkboxes are used when more than one option is required to be selected.
Question 13
1. True
2. False
Answer
False
Question 14
Answer
HTML forms are means to collect information/data from the site visitor. It is done with the help of
controls that collect the information and send it over.
Question 15
Answer
Users interact with forms through named objects called controls. A control's "control name" is given by
its name attribute. Each control has both an initial value and a current value, both of which are character
strings.
Some control types used in HTML are buttons, checkboxes, radio buttons, menus, password, text input
etc.
Question 16
Answer
1. Buttons
2. Checkboxes
3. Radio Buttons
4. Menus
5. Password
6. Text Input
7. Hidden Controls
Question 17
Write the tags to define the following :
(viii) A Label
Answer
Grade : A B C
Subjects : English Maths
Computers Accounts
Economics
Business Studies
Answer
Output
Question 19
Answer
Question 1
Create a form as given below by using different Form tags and attributes.
(Hint : Also use Pre, Input, Select, Option tags for this)
Answer
<HTML>
<BODY>
<FORM>
<H1> My Guest Book </H1>
<P>
Please let me know what you think of my Web Pages. Thanks !
</P>
<TABLE BORDER = "0" RULES = "NONE" FRAME = "VOID">
<TR>
<TD> <PRE>What is your name ?</PRE> </TD>
<TD> <INPUT TYPE = "TEXT" NAME = "NAME" /> </TD>
</TR>
<TR>
<TD> <PRE>What is your e-mail address :</PRE> </TD>
<TD> <INPUT TYPE = "TEXT" NAME = "EMAILID" /> </TD>
</TR>
</TABLE>
<BR>
Check all that apply:
<BR>
<INPUT TYPE = "CHECKBOX" ID = "C1" NAME = "C1" VALUE = "I really
like your Web Site.">
<LABEL FOR = "C1">I really like your Web Site.</LABEL>
<BR>
<INPUT TYPE = "CHECKBOX" ID = "C2" NAME = "C2" VALUE = "One of the
best site I've seen.">
<LABEL FOR = "C2">One of the best site I've seen.</LABEL>
<BR>
<INPUT TYPE = "CHECKBOX" ID = "C3" NAME = "C3" VALUE = "I have no
taste so your site didn't do much for me.">
<LABEL FOR = "C3">I have no taste so your site didn't do much for
me.</LABEL>
<BR>
<BR>
Choose the one thing you love best of my pages:
<BR>
<INPUT TYPE = "RADIO" ID = "O1" NAME = "OPINION"
VALUE = "That gorgeous picture of you and your dogs.">
<LABEL FOR = "O1">That gorgeous picture of you and your
dogs.</LABEL>
<BR>
<INPUT TYPE = "RADIO" ID = "O2" NAME = "OPINION"
VALUE = "The inspiring recap about your childhood.">
<LABEL FOR = "O2">The inspiring recap about your childhood.</LABEL>
<BR>
<INPUT TYPE = "RADIO" ID = "O3" NAME = "OPINION"
VALUE = "The detailed list of your hobbies.">
<LABEL FOR = "O3">The detailed list of your hobbies.</LABEL>
<BR>
<BR>
Imagine my site as a book, video or album.
<BR>
What do you think about my site?
<BR>
<SELECT NAME = "DETAILS" SIZE = "3">
<OPTION VALUE = "ADD MORE DETAILS ABOUT YOUR HOBBIES!" SELECTED>
ADD MORE DETAILS ABOUT YOUR HOBBIES!
</OPTION>
<OPTION VALUE = "ADD PICTURES OF YOUR CHILDHOOD">
ADD PICTURES OF YOUR CHILDHOOD
</OPTION>
<OPTION VALUE = "ADD YOUR FAVOURITES">
ADD YOUR FAVOURITES
</OPTION>
</SELECT>
<INPUT TYPE = "SUBMIT" NAME = "SUBMIT" VALUE = "Click here to
submit" />
</FORM>
</BODY>
</HTML>
Output
Question 2
Create a webpage that receives pizza orders through a web form as shown below :
Answer
<HTML>
<BODY BGCOLOR = "YELLOW">
<FORM>
<H1> Pizza Factory </H1>
<HR>
<P>
<B> Pizza Order Form </B>
</P>
Output
Formative Assessment
Question 1(a)
Consider the following code fragments and determine how these code fragments would create form
elements, i.e., draw how their output would appear in browser.
Consider the following code fragments and determine how these code fragments would create form
elements, i.e., draw how their output would appear in browser.
Question 1(c)
Consider the following code fragments and determine how these code fragments would create form
elements, i.e., draw how their output would appear in browser.
Question 1(d)
Consider the following code fragments and determine how these code fragments would create form
elements, i.e., draw how their output would appear in browser.
Consider the following code fragments and determine how these code fragments would create form
elements, i.e., draw how their output would appear in browser.
Consider the following code fragments and determine how these code fragments would create form
elements, i.e., draw how their output would appear in browser.
Male
<input type= "radio" value="male"><br>
Female
<input type= "radio" value="female">
Answer
Consider the following code fragments and determine how these code fragments would create form
elements, i.e., draw how their output would appear in browser.
Male
<input type="radio" value="male"><br>
Female
<input type="radio" value="female" checked>
Answer
Consider the following code fragments and determine how these code fragments would create form
elements, i.e., draw how their output would appear in browser.
YES
<input type="checkbox" value="yes"><br>
NO
<input type="checkbox" value="no">
Answer
Consider the following code fragments and determine how these code fragments would create form
elements, i.e., draw how their output would appear in browser.
YES
<input type="checkbox" value="yes" checked><br>
NO
<input type="checkbox" value="no">
Answer