Duration
42 minutes
Number of Questions 42 multiple choice questions
Each question has between 1 and 8 options of which 1 or more
may be correct
HTML5 Test Contents
• HTML
5 Elements and attributes
• HTML
5 Events
• HTML
5 syntax
• HTML
5 Web application APIs
•
Loading HTML 5 Web pages
Latest HTML5 oDesk Test Questions and Answers
Question: 01
Which media event is triggered when there is an error in
fetching media data in HTML 5.0?
a. onstalled (Answer)
b. onwaiting
c. onsuspend
d. oninvalid
Question: 02
Which of the following video file formats are currently
supported by the <video> element of HTML
5.0?
a. CCTV
b. MPEG 4 (Answer)
c. Ogg **
d. 3GPP
Question: 3
Which of the following video file formats are currently supported by the
<video> element of HTML5?
Note: There may be more
than one right answer
a. CCTV
b. MPEG 4
(Answer)
c. Ogg
(Answer) ***
d. 3GPP
Question: 04
Which of the following is NOT a valid value for the
a. It is used to define the restrictions to the frame content.
(Answer)
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.
Question: 05
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 (Answer)
Question: 06
When is the window onstorage event triggered in the HTML
document?
a. It is triggered when the window is resized.
b. It is triggered when a document loads.
c. It is triggered when a document performs an undo function.
(Answer)
d. It is triggered when the window becomes visible.
Question: 07
Which of the following is NOT a valid attribute for the
<video> element in HTML 5.0?
a. controls
b. autoplay
c. disabled (Answer)
d. preload
Question: 08
Suppose you add the input code given above to your HTML web
page. What result will be returned
by the JavaScript function when you click the button marked
as A in the image?
a.number
b.text (Answer)
c.button
d.None of the above
Question: 09
How does a button created by the <button> tag differ
from the one created by an <input>tag ?
a. An input tag button can be a reset button too. **
b. A button tag button can be a reset button too.
c. An input tag button can include images as well. (Answer)
d. A button tag can include images as well. *
Question: 10
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> (Answer)
c. <source>
d.<progress>
Question: 11
Which of the following is NOT a valid attribute for the
element in HTML 5.0?
a.hreflang *
b.rel
c.http-equiv (Answer)
d.media
Question: 12
Which of the following are valid values for the
contenteditable attribute of theelement in HTML 5.0?
a.true (Answer)
b.false (Answer)
c.0
d.1
Question: 13
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> (Answer)
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: 14
Which of the following <section> elements have the
correct attribute assignment as per HTML 5.0?
a. <section id=”example”>…</section
id=”example”>
b. <section id=”example”>…</section id=”example2″>
c. <section id=”EXAMPLE”>…</section> (Answer)
d. <section id=”Example”>…</section> (Answer)
e. <section id=”example”>…</section> (Answer)
Question: 15
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 respond with a positive or negative
response.
c. It will show the
modal text field prompt with the given message to the user, and ask the user to
either respond with a string value or abort.
d. Both b and c. (Answer)
Question: 16
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 (Answer)
Question: 17
Which media event will be fired when a media resource
element suddenly becomes empty?
a. onerror
b. onended
c. onloadeddata
d. onemptied (Answer)
Question: 18
What is the purpose of the <keygen> element in HTML
5.0?
a. It is used to define a keyboard text in an HTML 5.0 web
page.
b. It is used to generate a public-private key pair in an HTML
5.0 web page. (Answer)
c. It is used to define a definition term in an HTML 5.0 web
page.
d. It is used to define a variable in an HTML 5.0 web page.
Question: 19
Which event is fired when an element loses its focus in HTML
5.0 document?
a. onfocus
b. onload
c. onblur (Answer)
d. onselect
Question: 20
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. p
c. ls
d. pre (Answer)
Question: 21
Which HTML 5.0 element will you use to group the related
options in a drop-down list?
a. optgroup (Answer)
b. option
c. menu
d. var
e. nav
Question: 22
You are writing the code for an HTML form and you want the
browser to retain the form’s input values. That is, if a user submits the form
and presses the browser’s 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 (Answer)
Question: 23
You are writing the code for an HTML form and
you want the browser to retain the form’s input values. That is, if a user
submits the form and presses the browser’s back button, the fully populated
form is displayed instead of a blank form. Which of the following HTML 5
attributes will you use?a. accept
b) autofocus (Answer)
c) autocomplete (Answer)
d. formtarget
Question: 24
Which of the following tags would assist in creating named
groups within a select list?
a. opt
b. group
c. optgroup (Answer)
d. selectgroup
Question: 25
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) (Answer)
b. window.clearTimeout (handle)
c. window.setInterval (code, timeout)
d. window.setTimeout (code, timeout)
a.
<tr>
<th>Customer Name</th>
<th rowspan=3>Contact</th>
</tr>
b. <tr>
<th>Customer
Name</th>
<th
colspan=3>Contact</th>
</tr> (Answer)
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: 26
What is the default background color for the canvas element
in HTML 5.0?
a. Black
b. White
c. Transparent (Answer)
d. Gray
Question: 27
Which of the following are valid values for the
contenteditable attribute of the <figure> element in HTML 5.0?
a. true (Answer)
b. false (Answer)
c. 0
d. 1
Question: 28
Which media event is triggered when there is an error in
fetching media data in HTML 5.0?
a. onstalled
b. onwaiting
c. onsuspend (Answer)
d. oninvalid
Question: 29
Which of the following is NOT a valid attribute for the
<link> element in HTML 5.0?
a. hreflang
b. rel
c. http-equiv (Answer)
d. media
Question: 30
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> (Answer)
c. <source>
d. <progress>
Question: 31
How does a button created by the <button> tag differ
from the one created by an <input> tag?
a. An input tag button can be a reset button too.
b. A button tag button can be a reset button too.
c. An input tag button can include images as well. (Answer)
d. A button tag can include images as well.
Question: 32
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 (Answer)
c. onunload
d. onreset
Question: 33
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 (Answer)
c. window.frameElement
d. None of the above
Question: 34
Suppose you add the input code given above to your HTML web
page. What result will be returned by the JavaScript function when you click
the button marked as A in the image?
a. number
b. text (Answer)
c. button
d. None of the above
Question: 35
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. (Answer)
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: 36
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. .tnemucod ruoy ot nettirw eb dluohs taht txet emos si ereH
(Answer)
b. Here is some text that should be written to your
document.
c. Here is some text that should be written to your
document.
d. None of the above.
Question: 37
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”> (Answer)
d. <body color=”Yellow”>
Question: 38
How will you change the value of the cookies and items in
the Storage objects of the localStorage attributes in HTML 5.0?
a. By invoking the window.dialogArguments() API method.
b. By invoking the window. navigator.yieldForStorageUpdates()
API method. (Answer)
c. By invoking the window.navigator.appName API method.
Question: 39
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. The target URL will open in the parent document.
b. The target URL will open in a new window.
c. The target URL will open in the same document in which it was
clicked. (Answer)
d. The target URL will open in the full body of the window.
Question: 40
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. It will load the linked document in the topmost frame.
(Answer)
c. It is used in the situation where a frameset file is
nested inside another frameset file.
d. Both a and c.
Question: 41
Which of the following is an INVALID value for the type
attribute of command tag?
a. checkbox
b. radio
c. command *
d. text (Answer)
Question: 42
The following link is placed on an HTML webpage.
<a href=”http://msdn.com/” target=”_blank”> MSDN
</a>
What do you infer from it?
a. It will open the site msdn.com in the same window.
b. It will open the site msdn.com in a new window. (Answer)
c. It will open the site msdn.com in a frame below.
d. It will not be clickable as it is not formed correctly.
Question: 43
You have the following directory structure.
webroot->products->ordered->delivered
The products directory has a page called Products.html and
the delivered directory has a page called Delivered.html. You want to provide a
link to the Products page on Delivered.html. The ideal code should be:
a. <a href=”././Products.html”> All Products
</a>
b. <a href=”../../Products.html”> All Products </a>
(Answer)
c. <a href=”…/…/Products.html”> All Products
</a>
d. <a href=”../Products.html”> All Products </a>
e. <a href=”Products.html”>
All Products</a>
Question: 44
What will be the result if you use the following code to
your HTML 5.0 document?
<p>I use <del>MAC</del>
<ins>Microsoft</ins>!</p>
a. I use MAC Microsoft!
b. I use MAC Microsoft!
c. I use MAC Microsoft! (Answer)
d. I use MAC Microsoft!
Question: 45
Which of the following is the correct syntax to define a
charset in the HTML 5 <meta> element?
a. <meta http-equiv=”content-type” content=”text/html;
charset=ISO-8859-1″>
b. <meta charset=”ISO-8859-1″> (Answer)
c. Neither a nor b.
Question: 46
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 (Answer)
Question: 47
Which of the following is a valid attribute for the
<colgroup> element in an HTML 5.0 document?
a. char
b. span (Answer)
c. align
d. width
Question: 48
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. All of the above
(Answer)
Question: 49
Which of the following elements preserves spaces and line
breaks, and displays the text in fixed-width font?
a. <xmp>
b. <pre> (Answer)
c. <p>
d. <q>
e. <br>
Question: 50
Which <body> tag event is fired when the user leaves
the document?
a. onunload (Answer)
b. onundo
c. onredo
d. onerror
Question: 51
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 (Answer)
c. set-cookie (Answer)
d. keywords*
e. refresh
f. author*
Question: 52
A computer programming book has to go online. Which of the
following tags is ideal for displaying the program snippets?
a. <emp>
b. <code> (Answer)
c. <dfn>
d. <cite>
Question: 53
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 (Answer)
Question: 54
What is the role of the <dfn> element in HTML 5.0?
a. It is used to define important text.
b. It is used to define computer code text.
c. It is used to define sample computer code.
d. It is used to define a definition term (Answer)
Question: 55
Which of the following is NOT a valid syntax for the <link>
element in HTML 5.0?
a. <link rel=”icon” href=”abc.jpg” sizes=”16×16″>
b. <link rev=”stylesheet” href=”abc.css” type=”text/css”
target=”_parent”>
c. <link rel=”alternate” type=”application/pdf”
hreflang=”fr” href=”manual-fr”>
(Answer)
Question: 56
Which of the following are valid HTML 5.0 elements?
a. <canvas> (Answer)
b. <summary>
c. <aside> (Answer)
d. <video> (Answer)
Question: 57
Which of the following is NOT a valid syntax for the
<h1> element in HTML 5.0?
a. <h1> This is header 1</h1>
b. <h1 align=”center”> This is header 1</h1>
c. <h1 onClick=”dothis(‘sc1′)” >This is header
</h1>
d. <h1 style=”cursor:auto;”>This is header </h1>
(Answer)
Question: 58
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 same way as the SHIFT key on
your keyboard.
b. <hr> element is used to insert the horizontal line
within your document and <br> element is used to insert a single line
break. (Answer)
c. <hr> element is used to put a line across the page
and <br> element acts in the same way as the ENTER key on your keyboard.
Question: 59
What will be the return value when using the
window.navigator.appName API method in an HTML 5.0 web application?
a. It will return the version of the browser.
b. It will return the complete User-Agent header.
c. It will return the name of the platform.
d. It will return the name of the browser. (Answer)
Question: 60
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 (Answer)
c. PostScript
d. None of the above
Question: 61
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 asynchronously when an element is inserted
in the document.
c. It is used to queue calls to history.back() and similar APIs.
(Answer)
d. All of the above.
Question: 62
Which <iframe> attribute is used to define the
restrictions to the frame content in HTML 5.0?
a. seamless
b. sandbox (Answer)
c. srcdoc
Question: 63
In HTML 5.0, what is the function of the sandbox attribute
when used with <iframe> as shown below?
a. It is used to define the restrictions to the frame content.
(Answer)
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.
Question: 64
Which of the following statements is/are correct for a
blockquote?
a. It makes the text a bit bigger for emphasizing.
b. It defines the start of a long quote. (Answer)
c. It makes the text slightly bolder.
Question: 65
Which event is fired when the history of the browser window
changes?
a. onpopstate (Answer)
b. onstorage
c. onresize
d. onhashchange
Question: 66
Which of the following <link> attributes are NOT
supported in HTML 5.0?
a. sizes
b. rev
c. rel
d. charset (Answer)
Question: 67
Suppose you placed four radio buttons on a web form. Which
of the following statements is correct for the code shown above?
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. (Answer)
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: 68
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. It gets fired when an element leaves a valid drop target.
(Answer)
c. It gets fired at the end of a drag operation.
d. It gets fired while an element is being dragged.
Question: 69
Which of the following are valid mouse events in HTML 5.0?
a. ondblclick * (Answer)
b. ondragstart * (Answer)
c. ondragenter (Answer)
d. onscroll (Answer)
e. ondrop (Answer)
Question: 70
Which of the following <iframe> attributes are NOT
supported in HTML 5.0?
a. height
b. marginheight (Answer)
c. sandbox
d. scrolling (Answer)
Question: 71
In HTML 5.0, which of the following attributes of the
<object> element refers to the location of the object’s data?
a. type
b. codebase
c. data (Answer)
d. usemap
Question: 72
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 B’s opener browsing context.
c. The origin of the active document of A is the same as the
origin of the active document of B.
d. All of the above (Answer)
Question: 73
Which of the following is an INVALID parameter for the
window.navigator.registerContentHandler API method in an HTML 5.0 web
application?
a. url
b. mimeType
c. scheme (Answer)
d. title
Question: 74
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. The target URL will open in the parent document.
b. The target URL will open in a new window.
c. The target URL will open in the same document in which it was
clicked. (Answer)
d. The target URL
will open in the full body of the window.
Question: 75
You specified a base tag and anchors as follows:
1. <base target=”_blank”>
2. <a href=”http://www.yahoo.com”>Yahoo</a>
(Answer)
3. <a href=”http://www.google.com”
target=”_top”>Google</a>
Which of the following is true of the above code?
a. Only the Yahoo link will open in a new window. (Answer)
b. Only the Google link will open in a new window.
c. Both links will open in a new window.
d. Both links will open in the same window.
Question: 76
When is the window onstorage event triggered in the HTML
document?
a. It is triggered when the window is resized.
b. It is triggered when a document loads. (Answer)
c. It is triggered when a document performs an undo function.
d. It is triggered when the window becomes visible.
Question: 77
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. (Answer)
c. The script will be executed asynchronously, as soon as it
is available.
Question: 78
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. (Answer)
c. The script will run when media data is loaded.
d. The script will run when the length of the media is
changed.
Question: 79
What is the output when you use the HTML 5.0 code snippet
shown below?
<body onload=”alert(this)”>
a. It will alert saying “[object HTMLBodyElement]” when the
document is loaded.
b. It will alert saying “[object Window]” when the document is
loaded. (Answer)
c. It will alert saying “[this]” when the document is
loaded.
d. The alert message is not properly defined in the body
element and an error will be generated when the document is loaded.
Question: 80
Which of the following represents INVALID syntax for
defining an attribute value in an HTML 5.0 document?
a. <input name =’be evil’ />
b. <input name=be evil /> *
c. <input name =
“be-evil” />
d. All of the above.
(Answer)
Question: 81
What is the purpose of the <q> element in HTML 5.0?
a. It is used to define the start of a term in a definition
list.
b. It is used to define attribute values for one or more
columns in a table.
c. It is used to define the start of a short quotation. (Answer)
d. It is used to define what to show browsers that do not
support the ruby element.
Question: 82
Which of the following events is NOT supported in HTML 5.0?
a. oninput
b. oninvalid
c. ondrop
d. onreset (Answer)
Question: 83
Which of the following is NOT a valid value for the
<iframe> sandbox attribute in HTML 5.0?
a. url (Answer)
b. allow-scripts
c. allow-same-origin
d. allow-forms
Question: 84
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?
a. <a
href=”mailto:webmaster@xcompany.com”>webmaster</a> (Answer)
b. <a
href=”webmaster@xcompany.com”>webmaster</a>
c. <a http=”mail:webmaster@xcompany.com”>webmaster</a>
d. <mail
http=”send:webmaster@xcompany.com”>webmaster</mail>
Question: 85
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?
This question is
based upon the figure shown below:
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. (Answer)
d. User should define a placeholder attribute to the input
element whose type is url.
Question: 86
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 (Answer)
c. rowspan
d. row
Question: 87
What does the icon attribute of the HTML 5.0 command tag
define?
<command icon=”?”>Click Me!</command>
a. It is used to define the url of an image to display as the
command. (Answer)
b. It is used to define the name of the radiogroup this
command belongs to.
c. It is used to define if the command is checked or not.
d. It is used to define if the command is available or not.
Question: 88
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. A link element whose href is “B”
b. A link element whose href is “A” (Answer)
c. None of the above
Question: 89
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 (Answer)
b. command
c. checkbox
d. radio
Question: 90
Consider the following items of a <select> list:
<option value=”89″>Item 1</option>
<option value=”90″>Item 2</option>
Which of the following values would be passed on by clicking
the submit button on selecting Item 2 from the list?
a. 89
b. 90 (Answer)
c. Item 1
d. Item 2
Question: 91
What is the function of onobsolete, an application cache API
method in HTML 5.0?
a. It reflows the HTML document using updated cached content.
b. It triggers an event when the cache content has been marked
as obsolete. (Answer)
c. It triggers an event when the cache content has been
updated.
d. It updates the cache for the current document in the
background.
Question: 92
Consider the above code. What will be the impact upon the
contents of the element if both the style sheets define the same class?
This question is based upon the figure shown below:
a. The contents of the element will be of red color and will
inherit all the effects of style.css.
b. The contents of the element will be of blue color and will
inherit all the effects of style1.css. (Answer)
c. The contents of the element will be of white color and
will inherit all the effects of style.css and style1.css.
d. None of the style effects will be applied to the contents
of the element.
Question: 93
Which of the following shows correct use of client-side data
validation in HTML5, on username and password fields in particular?
<input name="username" required />
<input name="pass" type="password" required/>
<input name="username" validate="true"/> (Answer)
<input name="pass"
type="password" validate="true"/> (Answer)
<input name="username" validate/>
<input name="pass" type="password" validate/>
Question: 94
True or false:
JavaScript objects can be stored directly into localStorage.
True (Answer)
False *
Question: 95
Once an application is offline, it remains cached until the
following happens (select all that apply):
b. The manifest file is modified (Answer)
Question: 96
Once an application is offline, it remains cached until the
following happens (select all that apply)
Note: There may be more than one right answer.
a.The application cache is
programmatically updated. (Answer)
b.The application cache gets automatically cleared by the
browser.
c.The manifest file is modified.
(Answer)
d.The user clears their browser's
data storage for the site. (Answer)
Question: 97
What is the difference between Server-Sent Events (SSEs) and
WebSockets in HTML5?
a.WebSockets can perform bi-directional
(client-server and vice versa) data transfers, while SSEs can only push data to
the client/browser. (Answer)
b.SSEs can perform bi-directional (client-server and vice
versa) data transfers, while WebSockets can only push data to the
client/browser.
c.WebSockets and SSEs are functionally equivalent.
d.None of these
Question: 98
Which method of HTMLCanvasElement is used to represent image
of Canvas Element?
a.toDataURL()(Answer)
b.saveAsImage()
c.saveFile()
d.exportImage()
Question: 99
Which of the following are the valid values of the <a>
element's target attribute in HTML5?
Note: There may be more than one right answer
a._blank (Answer)
b. _self (Answer)
c. _top (Answer)
Question: 100
Which of the following are the valid values of the <a>
element's target attribute in HTML5?
Note: There may be more than one right answer.
_blank (Answer)
_self (Answer)
_top (Answer)
_bottom (Answer)
Question: 101
Which of the following is the correct way to play an audio
file in HTML5?
Note: There may be more than one right answer
b. <audio controls>
<source
src="horse.ogg" type="audio/ogg">
<source
src="horse.mp3" type="audio/mpeg">
</audio> (Answer)
Question: 102
Which of the following is the correct way to play an audio file in HTML5?
a) var snd = new Audio(“file.wav”);
snd.play();(Answer)
b) <audio controls>
<source
src=”file.ogg” type=”audio/ogg”>
<source
src=”file.mp3″ type=”audio/mpeg”>
</audio>
(Answer)
Question: 103
What does P2P streaming mean when web applications establish
a P2P HTTP connection using HTML?
a.It means that streaming of a voice/video frame is direct,
without using any server between them. *
b.It means that streaming of a
voice/video frame is first between one peer to the server then the server to
another peer. (Answer)
c.Communication does not rely on a shared relay server in
the network.
Question: 104
Which of the following methods can be used to estimate page
load times?
Note: There may be more than one right answer.
a.Using _gaq.push(['_trackPageLoadTime']) with Google Analytics.
b.Using the Navigation Timing
JavaScript API. (Answer) *
c.Page load times cannot be estimated.
d.Using built-in JavaScript
methods. (Answer)
Question: 105
When does the ondragleave mouse event get fired in HTML5?
a. It gets fired when
an element has been dragged to a valid drop target
b. It gets fired when
an element leaves a valid drop target (Answer)
c. . It gets fired at the end of a drag operation
d. It gets fired
while an element is being dragged
Question: 106
Which HTML5 doctype declarations are correct?
a. <!doctype
html>
b) <!DOCTYPE html> (Answer)
*
<!DOCTYPE HTML5>
d) <!DOCTYPE HTML>(Answer)
Question: 107
What is the purpose of the <keygen> element in HTML5?
a. It is used to
define a keyboard text in an HTML 5 web page
b. It is used to
generate a public-private key pair in an HTML 5 web page
c. It is used to
define a definition term in an Html 5 web page
d. It is used to
define a variable in an HTML5 web page
Question: 108
Which of the following are valid ways to associate custom data
with an HTML5 element?
Note: There may be more than one right answer.
a.<tr class="foo"
data-id-type="4"> (Answer) *
b.<tr class="foo" id-type="4">
c.<tr class="foo"
data-id_type="4"> (Answer)
d.All of the above.
Question: 109
Consider the following JavaScript code:
var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
var img=document.getElementById("img");
Which method will correctly draw an image in the x=10, y=10
position?
a.
ctx.drawImage(img,10,10); *
b.
context.drawImage(img,20,10,10,10);
c.
context.drawImage(img,10,20,10,10,20,20,10,10); (Answer)
d. All of these
Question: 110
The following are valid use cases of client file/directory
access in HTML5, except:
a.Drag and drop files from the desktop
b.Full file system access
c.Use of the HTML5 File API
(Answer)
d.Use of files as HTML5 input types
Question: 111
Which of the following code is used to prevent Webkit spin
buttons from appearing on web pages?
a. input[type=number]::-webkit-inner-spin-button {
-webkit-appearance:
none;
}
b.
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
} (Answer)
c. noindex:-o-prefocus,
input[type=number]
{
padding-right:
1.2em;
}
d. input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none;
padding-right:
1.2em;
}
Question: 112
What is the internal/wire format of input
type="date" in HTML5?
a.DD-MM-YYYY
b.YYYY-MM-DD (Answer)
c.MM-DD-YYYY
d.YYYY-DD-MM
Question: 113
How can audio files be played in HTML5?
var sound = new Audio("file.wav");
a.sound.begin();
b.sound.resume();
c.sound.start();
d.sound.play(); (Answer)
Question: 114
Which of the following is the correct way to store an object
in localStorage?
var obj = { 'one': 1, 'two': 2, 'three': 3 };
a. localStorage.setItem('obj', obj);
b.localStorage.setItem('obj',
JSON.stringify(obj)); (Answer)
c.localStorage.setItem('testObject',
JSON.parse(testObject));
d.localStorage.setItem(obj);
Question: 115
Which of the following will detect when an HTML5 video has
finished playing?
a.
var video = document.getElementsByTagName('video')[0];
video.onended = function(e) {
} (Answer)
b. var video = document.getElementsByTagName('video')[0];
video.onPlayend =
function(e) {
}
c. var video = document.getElementsByTagName('video')[0];
video.onPlayFinish
= function(e) {
}
d. var video = document.getElementsByTagName('video')[0];
video.onPlayBackended = function(e) {
}
Question: 116
1. Assuming that some text needs to be written on an HTML5
canvas, select a replacement for the commented line below:
<canvas id="e" width="200"
height="200"></canvas>
<script>
var canvas =
document.getElementById("e");
//insert code here
context.fillStyle =
"blue";
context.font =
"bold 16px Arial";
context.fillText("Zibri", 100, 100);
</script>
a. var context = canvas.getContext();
b.var context = canvas.getElementById("context");
c.var context =
canvas.getContext("2d"); (Answer)
d.var context = canvas.getElementById("2d");
Question: 117
Which following are valid default values for the <input
type="date"> HTML5 element?
now
2013-05-30 *
2013-30-05
Today (Answer)
Question: 118
Which of the following will restrict an input element to
accept only numerical values in a text field?
Note: There may be more than one right answer.
a.
<input type="text" pattern="[0-9]*" />
(Answer)
b. <input
type="number" /> (Answer)
c.
<input type="text" pattern="\d*"/> (Answer)
d. <input
type="text" pattern="number"/>
Question: 119
Which of the following are true about the ARIA role
attribute in HTML5?
Note: There may be more than one right answer.
a.Every HTML element can have an
ARIA role attribute specified. (Answer) *
b.Every HTML element is required have an ARIA role attribute
specified.
c.The attribute must have a value
that is a set of space-separated tokens representing the various WAI-ARIA roles
that the element belongs to. (Answer)
d.There is no ARIA attribute called "role".
No comments:
Post a Comment