Professional Documents
Culture Documents
Question: You want to display a table listing out customer names and their contact information. The heading
of the table is shown in the given figure. What is the code for creating the first line of the table heading?
a.
<tr>
<th>Customer Name</th>
<th rowspan=3>Contact</th>
</tr>
b.
<tr>
<th>Customer Name</th>
<th colspan=3>Contact</th>
</tr>
c.
<tr>
<th>Customer Name</th>
<th cellpadding=3>Contact</th>
</tr>
d.
<tr>
<th>Customer Name</th>
<th cellspacing=3>Contact</th>
</tr>
Question: What is the default background color for the canvas element in HTML 5.0?
a. Black
b. White
c. Transparent
d. Gray
Question: Which of the following are valid values for the contenteditable attribute of the <figure> element in
HTML 5.0?
a. true
b. false
c. 0
d. 1
Question: Which media event is triggered when there is an error in fetching media data in HTML 5.0?
a. onstalled
b. onwaiting
c. onsuspend
d. oninvalid
Question:Which of the following is NOT a valid attribute for the <link> element in HTML 5.0?
a.hreflang
b. rel
c.http-equiv
d. media
Question: Which of the following HTML 5.0 elements is used to embed Java applets into your HTML 5.0 web
page?
a.
<applet>
b.
<object>
c.
<source>
d.
<progress>
Question:How does a button created by the <button> tag differ from the one created by an <input> tag?
a.
b.
c.
d.
Question: Which form event is fired on the click of a button using a button tag with its type attribute value
equal to submit?
a.
onload
b.
onsubmit
c.
onunload
d.
onreset
Question:How will you return a reference to the parent of the current window or subframe in an HTML 5.0 web
application?
a.
window.top
b.
window.parent
c.
window.frameElement
d.
Question:Which of the following attributes comes in handy when borders have to be put between groups of
columns instead of every column?
a.
col
b.
colgroup
c.
rowspan
d.
row
Question:Which of the following video file formats are currently supported by the <video> element of HTML
5.0?
a.
CCTV
b.
MPEG 4
c.
Ogg
d.
3GPP
number
b.
text
c.
button
d.
Question: Which of the following statements is correct if you allow the user to select only one radio button
from a group of radio buttons?
a.
The name of the input tag must be the same for all the radio buttons.
b.
The value of the input tag must be the same for all the radio buttons.
c.
The display text of the input tag must be the same for all the radio buttons.
d.
All the radio buttons must be added to the same group using the <optgroup> tag.
Question:What will be the result if you use the following code to your HTML 5.0 document?
<bdo dir=rtl>
Here is some text that should be written to your document.
</bdo>
a.
b.
c.
d.
Question:Which of the following would give a yellow background to the web page?
Note: The code used in the correct answer below was deprecated in HTML 4.01! Use styles instead for new
code.
a.
<body backcolor=Yellow>
b.
<body background=Yellow>
c.
<body bgcolor=Yellow>
d.
<body color=Yellow>
Question:How will you change the value of the cookies and items in the Storage objects of the localStorage
attributes in HTML 5.0?
a.
b.
c.
Question: How will the target URL open when you define the <a> element in your HTML 5.0 document as
shown below?
<a href=http://www.yahoo.com target=_self>Click here</a>
a.
b.
c.
The target URL will open in the same document in which it was clicked.
d.
The target URL will open in the full body of the window.
Question:What will be the browsing context if the browsing context name is _top when the HTML 5.0 web page
is loading?
a.
It will put the new document in the same window and frame as the current document.
b.
c.
It is used in the situation where a frameset file is nested inside another frameset file.
d.
Both a and c.
Question: Which of the following is an INVALID value for the type attribute of command tag?
a.
checkbox
b.
radio
c.
command
d.
text
b.
c.
d.
b.
c.
d.
e.
Question:What will be the result if you use the following code to your HTML 5.0 document?
b.
c.
d.
Question:Which of the following is the correct syntax to define a charset in the HTML 5 <meta> element?
a.
b.
<meta charset=ISO-8859-1>
c.
Neither a nor b.
Question:Which of the following is NOT a supported attribute of the <ol> element in HTML 5.0?
a.
type
b.
reversed
c.
start
d.
compact
Question:Which of the following is a valid attribute for the <colgroup> element in an HTML 5.0 document?
a.
char
b.
span
c.
align
d.
width
Question:Which of the following is the correct method to load another web page or reload the same page in
HTML 5.0?
a.
<head>
<meta http-equiv=refresh content=5>
</head>
b.
<html>
<head>
<title>Auto Reload</title>
<script language=JavaScript>
<!
var time = null
function move() {
window.location = http://site.com
}
//>
</script>
</head>
<body onload=timer=setTimeout(move(),5000)>
<p>see this page refresh itself in 5 secs.<p>
</body>
</html>
c.
<head>
<meta http-equiv=refresh content=5;URL=http://yahoo.com >
</head>
d.
Question:Which of the following elements preserves spaces and line breaks, and displays the text in fixedwidth font?
a.
<xmp>
b.
<pre>
c.
<p>
d.
<q>
e.
<br>
Question:Which <body> tag event is fired when the user leaves the document?
a.
onunload
b.
onundo
c.
onredo
d.
onerror
Question:Which of the following is an INVALID keyword value for http-equiv attribute when used with the
<meta> element in HTML 5.0?
a.
content-type
b.
expires
c.
set-cookie
d.
keywords
e.
refresh
f.
author
Question:A computer programming book has to go online. Which of the following tags is ideal for displaying the
program snippets?
a.
<emp>
b.
<code>
c.
<dfn>
d.
<cite>
Question:Which of the following is NOT a valid value for the type attribute of the <input> element in HTML
5.0?
a.
url
b.
week
c.
tel
d.
radio
e.
datetime-local
f.
All of the above are the valid values for <input> element
b.
c.
d.
Question:Which of the following is NOT a valid syntax for the <link> element in HTML 5.0?
a.
b.
c.
<canvas>
b.
<summary>
c.
<aside>
d.
<video>
Question:Which of the following is NOT a valid syntax for the <h1> element in HTML 5.0?
a.
b.
c.
d.
Question:Which of the following statements are correct with regard to <hr> and <br> elements of HTML 5.0?
a.
<hr> element acts in the same way as the Tab key on your keyboard and <br> element acts in the
<hr> element is used to insert the horizontal line within your document and <br> element is
<hr> element is used to put a line across the page and <br> element acts in the same way as the
Question: What will be the return value when using the window.navigator.appName API method in an HTML
5.0 web application?
a.
b.
c.
d.
Question:Which of the following languages will you use to paint the graphics designed using the HTML 5.0
<canvas> tag?
a.
VB script
b.
JavaScript
c.
PostScript
d.
Question: What is the function of the history traversal task source in HTML 5.0?
a.
It is used for features that react to user interaction, for example, keyboard or mouse input.
b.
It is used for features that react to DOM manipulations, for example, the things that happen
d.
Question:Which <iframe> attribute is used to define the restrictions to the frame content in HTML 5.0?
a.
seamless
b.
sandbox
c.
srcdoc
Question: In HTML 5.0, what is the function of the sandbox attribute when used with <iframe> as shown below?
<iframe src=aaa sandbox=?></iframe>
a.
b.
It is used to define the URL of the document that should appear in the iframe.
c.
It is used to specify that an iframe should appear as if it is part of the document the iframe is in.
b.
c.
Question:Which event is fired when the history of the browser window changes?
a.
onpopstate
b.
onstorage
c.
onresize
d.
onhashchange
Question:Which of the following <link> attributes are NOT supported in HTML 5.0?
a.
sizes
b.
rev
c.
rel
d.
charset
a.
The user can choose only the male and the married options.
b.
The user can choose only the female and single options.
c.
The user can choose only one option out of the four.
d.
The user can choose all the four options at the same time.
e.
The user can choose one option from Male/Female and one from Married/Single.
Question:When does the ondragleave mouse event get fired in HTML 5.0?
a.
It gets fired when an element has been dragged to a valid drop target.
b.
c.
d.
ondblclick
b.
ondragstart
c.
ondragenter
d.
onscroll
e.
ondrop
Question:Which of the following <iframe> attributes are NOT supported in HTML 5.0?
a.
height
b.
marginheight
c.
sandbox
d.
scrolling
Question:In HTML 5.0, which of the following attributes of the <object> element refers to the location of the
objects data?
a.
type
b.
codebase
c.
data
d.
usemap
Question:In which of the following conditions is a browsing context A allowed to navigate a second browsing
context B?
a.
When the browsing context A is a nested browsing context and its top-level browsing context is B.
b.
When the browsing context B is an auxiliary browsing context and A is allowed to navigate Bs
The origin of the active document of A is the same as the origin of the active document of B.
All of the above
url
b.
mimeType
c.
scheme
d.
title
Question:How will the target URL open when you define the <a> element in your HTML 5.0 document as shown
below?
<a href=http://www.yahoo.com target=_self>Click here</a>
a.
b.
c.
The target URL will open in the same document in which it was clicked.
d.
The target URL will open in the full body of the window.
b.
c.
d.
b.
c.
d.
Question:In HTML 5.0, how will the script be executed if you use the script element shown below?
<script src=script.js type=text/javascript defer=defer></script>
a.
The script is fetched and executed immediately, before the user agent continues parsing the page.
b.
The script will be executed when the page has finished parsing.
c.
Question:Which of the following is correct with regard to the oncanplaythrough event fired by media resources
in the HTML 5.0 document?
a.
The script will run when the media has reached the end.
b.
The script will run when the media is played to the end, without stopping for buffering.
c.
d.
The script will run when the length of the media is changed.
Question:What is the output when you use the HTML 5.0 code snippet shown below?
<body onload=alert(this)>
a.
b.
c.
d.
The alert message is not properly defined in the body element and an error will be generated when
Question:Which of the following represents INVALID syntax for defining an attribute value in an HTML 5.0
document?
a.
b.
c.
d.
b.
c.
d.
It is used to define what to show browsers that do not support the ruby element.
oninput
b.
oninvalid
c.
ondrop
d.
onreset
Question:How will you cancel the timeouts that are set with the setInterval() API method identified by the
handlers in HTML 5.0?
a.
window.clearInterval (handle)
b.
window.clearTimeout (handle)
c.
d.
Question:Which of the following tags would assist in creating named groups within a select list?
a.
opt
b.
group
c.
optgroup
d.
selectgroup
Question:You are writing the code for an HTML form and you want the browser to retain the forms input
values. That is, if a user submits the form and presses the browsers back button, the fully populated form is
displayed instead of a blank form. Which of the following HTML 5.0 attributes will you use?
a.
accept
b.
autofocus
c.
autocomplete
d.
formtarget
Question:Which HTML 5.0 element will you use to group the related options in a drop-down list?
a.
optgroup
b.
option
c.
menu
d.
var
e.
nav
This question is based upon the figure shown below (refer the image)
Question:How will you bind the datalist option (shown below) with an <input> element, whose type attribute is
set to url, to get the result shown in the image?
a.
User should define an accept attribute to the input element whose type is url.
b.
User should define multiple attribute to the input element whose type is url.
c.
User should define a list attribute to the input element whose type is url.
d.
User should define a placeholder attribute to the input element whose type is url.
Question:What does the icon attribute of the HTML 5.0 command tag define?
<command icon=?>Click Me!</command>
a.
b.
It is used to define the name of the radiogroup this command belongs to.
c.
d.
Question:In HTML 5.0, which of the following is NOT a valid value for the type attribute when used with the
<command> tag shown below?
<command type=?>Click Me!</command>
a.
button
b.
command
c.
checkbox
d.
radio
Question:A piece of text contains many blank spaces within it. Which of the following tags would be suitable
to display the text as it was originally formatted?
a.
td
b.
c.
ls
d.
pre
Question:Which event is fired when an element loses its focus in HTML 5.0 document?
a.
onfocus
b.
onload
c.
onblur
d.
onselect
b.
c.
d.
Question:Which of the following is NOT a valid attribute for the <video> element in HTML 5.0?
a.
controls
b.
autoplay
c.
disabled
d.
preload
Question:While rendering your HTML 5.0 web page, which of the following <link> element files will get skipped
by a compliant user agent if you include the link elements shown below in your document?
<link rel=stylesheet href=A type=text/plain>
<link rel=stylesheet href=B type=text/css>
a.
b.
c.
Question:Which media event will be fired when a media resource element suddenly becomes empty?
a.
onerror
b.
onended
c.
onloadeddata
d.
onemptied
Question:Which of the following is NOT an attribute of the <meta> element in HTML 5.0?
a.
charset
b.
content
c.
http-equiv
d.
scheme
Question:Which of the following statements is correct if you invoke the window.prompt (message, default)
web application API method in HTML 5.0?
a.
It will only show the modal text field prompt with the given message to the user.
b.
It will show the modal text field prompt with the given message to the user, and ask the user to
It will show the modal text field prompt with the given message to the user, and ask the user to
Both b and c.
Question:Which of the following is NOT a valid value for the <iframe> sandbox attribute in HTML 5.0?
a.
url
b.
allow-scripts
c.
allow-same-origin
d.
allow-forms
Question:What is the function of onobsolete, an application cache API method in HTML 5.0?
a.
b.
It triggers an event when the cache content has been marked as obsolete.
c.
d.
Question:Which of the following <section> elements have the correct attribute assignment as per HTML 5.0?
a.
b.
c.
<section id=EXAMPLE></section>
d.
<section id=Example></section>
e.
<section id=example></section>
***************************************************************************************************************
Question:-Suppose there are three lines of text to be displayed. These lines are as follows: "First Line",
"Second Line" "New line" If you want "New Line"to be
Answer = B
Question:-A developer wrote this image tag: <img src ="states.gif" width ="330" height ="406" alt="States"
usemap ="#statemap" /> What code should follow this?
Answer = A
<body>
<p id="begins">First Attempt! </p>
<script> var txt=document.getElementById("begins").innerHTML; </script>
</body>
</html>
Answer = A?
Question:-Which of the following is the correct method to change the background color to indigo with help of
a button?
Answer = B?
Question:-Which of the following is the correct syntax to change the text 'WELCOME!' to 'Hello!'?
Answer = C?
Question:-You want to create a link for your website allowing users to email the webmaster. How will you
implement this if the webmaster's email address is webmaster@xcompany.com?
Answer = A
Question:-For adding a new child node before a specified child node, which of the following methods is used?
Answer = A
Question:-What will be the output of the following HTML code?
<!DOCTYPE html>
<html>
<body>
<p id="Begins">First Attempt! </p>
<script> x=document.getElementById("Begins"); document.write(x.nodeValue);
Answer = A
Question:-Suppose there are three lines of text to be displayed. These lines are as follows: "First Line",
"Second Line" "New line" If you want "New Line"to be displayed in between the other two lines, then which of
the following is the correct syntax to do so?
Answer = B?