Which of the following methods can be used to estimate page load times?
Note: There may be more than one right answer.
Using _gaq.push(['_trackPageLoadTime']) with Google Analytics.=====
Using the Navigation Timing JavaScript API.====
Page load times cannot be estimated.
Using built-in JavaScript methods.
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?
ctx.drawImage(img,10,10);======
context.drawImage(img,20,10,10,10);
context.drawImage(img,10,20,10,10,20,20,10,10);
All of these
What is the difference between Server-Sent Events (SSEs) and WebSockets in HTML5?
WebSockets can perform bi-directional (client-server and vice versa) data transfers, while SSEs can only push data to the client/browser.========
SSEs can perform bi-directional (client-server and vice versa) data transfers, while WebSockets can only push data to the client/browser.
WebSockets and SSEs are functionally equivalent.
None of these.
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===
_self=====
_top=====
_bottom
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.
The application cache is programmatically updated.===
The application cache gets automatically cleared by the browser.
The manifest file is modified.====
The user clears their browser's data storage for the site.====
Which of the following is the correct way to store an object in localStorage?
var obj = { 'one': 1, 'two': 2, 'three': 3 };
localStorage.setItem('obj', obj);
localStorage.setItem('obj', JSON.stringify(obj));=====
localStorage.setItem('testObject', JSON.parse(testObject));
localStorage.setItem(obj);
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.
CCTV
MPEG 4====
Ogg=====
3GPP
The following are valid use cases of client file/directory access in HTML5, except:
Drag and drop of files from the desktop
Full file system access
Use of the HTML5 File API=====
Use of files as HTML5 input types
Which HTML5 doctype declarations are correct?
Note: There may be more than one right answer.
<!doctype html>
<!DOCTYPE html>=====
<!DOCTYPE HTML5>
<!DOCTYPE HTML>
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?
accept
autofocus===
autocomplete====
formtarget
Which of the following are possible ways to make the browser automatically adds new images and discards deleted images with server-side events in HTML5?
Note: There may be more than one right answer.
Long Polling Ajax Requests
Server-sent Events====
WebSockets=====
JavaScript objects on the client via JSON.parse().
Which of the following is the correct way to play an audio file in HTML5?
Note: There may be more than one right answer.
var snd = new Audio("file.wav");
snd.play();
<audio controls>
<source src="file.ogg" type="audio/ogg">
<source src="file.mp3" type="audio/mpeg">
</audio>
<source src="file.mp3" type="audio/mpeg">
All of these.
What does P2P streaming mean when web applications establish a P2P HTTP connection using HTML?
It means that streaming of a voice/video frame is direct, without using any server between them.=====
It means that streaming of a voice/video frame is first between one peer to the server then the server to another peer.
Communication does not rely on a shared relay server in the network.
How can an HTML5 canvas size be changed so that it fits the entire window?
Note: There may be more than one right answer.
#myCanvas {height: 100%; width: 100%;}=====
<script type="text/javascript">=====
function resize_canvas(){
canvas = document.getElementById("canvas");
if (canvas.width < window.innerWidth)
{
canvas.width = window.innerWidth;
}
if (canvas.height < window.innerHeight)
{
canvas.height = window.innerHeight;
}
}
</script>
It depends upon the complexity of the canvas, and the frequency of redraws.
Calling the JavaScript getWidth() function.
When does the ondragleave mouse event get fired in HTML5?
It gets fired when an element has been dragged to a valid drop target.
It gets fired when an element leaves a valid drop target.=======
It gets fired at the end of a drag operation.
It gets fired while an element is being dragged.
Which of the following are valid HTML5 elements?
Note: There may be more than one right answer.
canvas
summary===
aside====
video====
How does a button created by the <button> tag differ from the one created by an <input> tag?
An input tag button can be a reset button too.
A button tag button can be a reset button too.
An input tag button can include images as well.=====
A button tag can include images as well.
Can we store JavaScript Objects directly into localStorage?
Yes=====
No
Which of the following code is used to prevent Webkit spin buttons from appearing on web pages?
input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none;
}
input[type=number]::-webkit-inner-spin-button,========
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
noindex:-o-prefocus,
input[type=number] {
padding-right: 1.2em;
}
input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none;
padding-right: 1.2em;
}
Which method of HTMLCanvasElement is used to represent image of Canvas Element?
toDataURL()====
saveAsImage()
saveFile()
exportImage()
What is the internal/wire format of input type="date" in HTML5?
DD-MM-YYYY
YYYY-MM-DD=====
MM-DD-YYYY
YYYY-DD-MM
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"/>
<input name="pass" type="password" validate="true"/>
<input name="username" validate/>
<input name="pass" type="password" validate/>
There is no way to implement client-side validation for the username and password fields in HTML5.
Which of the following statements are correct with regard to the <hr> and <br> elements of HTML5?
Note: There may be more than one right answer.
The <hr> element acts in the same way as the tab key and the <br> element acts in the same way as the shift key.
The <hr> element is used to insert the horizontal line within the document and the <br> element is used to insert a single line break.=======
The <hr> element is used to put a line across the page and the <br> element acts in the same way as a return/enter key press.
Which of the following is not a valid attribute for the <video> element in HTML5?
controls
autoplay
disabled====
preload
Which of the following <link> attributes are not supported in HTML5?
Note: There may be more than one right answer.
sizes
rev====
rel
charset=====
Which is the standard method for clearing a canvas?
context.clearRect ( x , y , w , h );====
canvas.width = canvas.width;
context.clear();
All of these.
Which of the following input element variations will show a numeric keypad in mobile browsers?
Note: There may be more than one right answer.
<input type="text" pattern="[0-9]*" />
<input type="number" />=======
<input type="text" keyboard="numeric" />
<input type="text" keyboard="number11" />
Which of the following are true regarding the <keygen> tag in HTML5?
Note: There may be more than one right answer.
The <keygen> tag specifies a key-pair generator field used for forms.====
The <keygen> tag generates a public/private key pair and then creates a certificate request. This certificate request will be sent to a Certificate Authority (CA), which then creates a certificate and sends it back to the browser.======
The <keygen> tag generates random passwords when the user requests for a password reset.
The <keygen> tag is deprecated in HTML5.
True or false:
JavaScript objects can be stored directly into localStorage.
True
False====
Which of the following is the correct way to store an object in a localStorage?
localStorage.setItem('testObject', JSON.stringify(testObject))====
localStorage.setItem('testObject', testObject)
localStorage.add('testObject', testObject)
localStorage.addItem('testObject', testObject)
Which of the following is not a valid syntax for the <link> element in HTML5?
<link rel="icon" href="abc.jpg" sizes="16x16">
<link rev="stylesheet" href="abc.css" type="text/css" target="_parent">=====
<link rel="alternate" type="application/pdf" hreflang="fr" href="manual-fr">
Which of the following is a proper syntax for <br> tag as W3C specs for HTML5 defines?
<br />====
<br/>
<br>
<br></br>
Which following are valid default values for the <input type="date"> HTML5 element?
now
2013-05-30====
2013-30-05
today
Which of the following are valid ways to associate custom data with an HTML5 element?
Note: There may be more than one right answer.
<tr class="foo" data-id-type="4">====
<tr class="foo" id-type="4">
<tr class="foo" data-id_type="4">======
All of the above.
What is the limit to the length of HTML attributes?
65536
64
There is no limit.====
None of these.
Which of the following will detect when an HTML5 video has finished playing?
var video = document.getElementsByTagName('video')[0];
video.onended = function(e) {======
}
var video = document.getElementsByTagName('video')[0];
video.onPlayend = function(e) {
}
var video = document.getElementsByTagName('video')[0];
video.onPlayFinish = function(e) {
}
var video = document.getElementsByTagName('video')[0];
video.onPlayBackended = function(e) {
}
Which of the following are true about the ARIA role attribute in HTML5?
Note: There may be more than one right answer.
Every HTML element can have an ARIA role attribute specified.=====
Every HTML element is required have an ARIA role attribute specified.
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.======
There is no ARIA attribute called "role".
Which of the following HTML5 features is capable of taking a screenshot of a web page?
Server-Sent Events
SVG
Canvas====
Web Workers
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>
var context = canvas.getContext();
var context = canvas.getElementById("context");
var context = canvas.getContext("2d");=====
var context = canvas.getElementById("2d");
What is the best way to define the character set of an HTML5 web page?
<meta http-equiv='charset' content='utf-8'>====
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<meta charset='utf-8'>
Note: There may be more than one right answer.
Using _gaq.push(['_trackPageLoadTime']) with Google Analytics.=====
Using the Navigation Timing JavaScript API.====
Page load times cannot be estimated.
Using built-in JavaScript methods.
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?
ctx.drawImage(img,10,10);======
context.drawImage(img,20,10,10,10);
context.drawImage(img,10,20,10,10,20,20,10,10);
All of these
What is the difference between Server-Sent Events (SSEs) and WebSockets in HTML5?
WebSockets can perform bi-directional (client-server and vice versa) data transfers, while SSEs can only push data to the client/browser.========
SSEs can perform bi-directional (client-server and vice versa) data transfers, while WebSockets can only push data to the client/browser.
WebSockets and SSEs are functionally equivalent.
None of these.
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===
_self=====
_top=====
_bottom
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.
The application cache is programmatically updated.===
The application cache gets automatically cleared by the browser.
The manifest file is modified.====
The user clears their browser's data storage for the site.====
Which of the following is the correct way to store an object in localStorage?
var obj = { 'one': 1, 'two': 2, 'three': 3 };
localStorage.setItem('obj', obj);
localStorage.setItem('obj', JSON.stringify(obj));=====
localStorage.setItem('testObject', JSON.parse(testObject));
localStorage.setItem(obj);
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.
CCTV
MPEG 4====
Ogg=====
3GPP
The following are valid use cases of client file/directory access in HTML5, except:
Drag and drop of files from the desktop
Full file system access
Use of the HTML5 File API=====
Use of files as HTML5 input types
Which HTML5 doctype declarations are correct?
Note: There may be more than one right answer.
<!doctype html>
<!DOCTYPE html>=====
<!DOCTYPE HTML5>
<!DOCTYPE HTML>
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?
accept
autofocus===
autocomplete====
formtarget
Which of the following are possible ways to make the browser automatically adds new images and discards deleted images with server-side events in HTML5?
Note: There may be more than one right answer.
Long Polling Ajax Requests
Server-sent Events====
WebSockets=====
JavaScript objects on the client via JSON.parse().
Which of the following is the correct way to play an audio file in HTML5?
Note: There may be more than one right answer.
var snd = new Audio("file.wav");
snd.play();
<audio controls>
<source src="file.ogg" type="audio/ogg">
<source src="file.mp3" type="audio/mpeg">
</audio>
<source src="file.mp3" type="audio/mpeg">
All of these.
What does P2P streaming mean when web applications establish a P2P HTTP connection using HTML?
It means that streaming of a voice/video frame is direct, without using any server between them.=====
It means that streaming of a voice/video frame is first between one peer to the server then the server to another peer.
Communication does not rely on a shared relay server in the network.
How can an HTML5 canvas size be changed so that it fits the entire window?
Note: There may be more than one right answer.
#myCanvas {height: 100%; width: 100%;}=====
<script type="text/javascript">=====
function resize_canvas(){
canvas = document.getElementById("canvas");
if (canvas.width < window.innerWidth)
{
canvas.width = window.innerWidth;
}
if (canvas.height < window.innerHeight)
{
canvas.height = window.innerHeight;
}
}
</script>
It depends upon the complexity of the canvas, and the frequency of redraws.
Calling the JavaScript getWidth() function.
When does the ondragleave mouse event get fired in HTML5?
It gets fired when an element has been dragged to a valid drop target.
It gets fired when an element leaves a valid drop target.=======
It gets fired at the end of a drag operation.
It gets fired while an element is being dragged.
Which of the following are valid HTML5 elements?
Note: There may be more than one right answer.
canvas
summary===
aside====
video====
How does a button created by the <button> tag differ from the one created by an <input> tag?
An input tag button can be a reset button too.
A button tag button can be a reset button too.
An input tag button can include images as well.=====
A button tag can include images as well.
Can we store JavaScript Objects directly into localStorage?
Yes=====
No
Which of the following code is used to prevent Webkit spin buttons from appearing on web pages?
input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none;
}
input[type=number]::-webkit-inner-spin-button,========
input[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
noindex:-o-prefocus,
input[type=number] {
padding-right: 1.2em;
}
input[type=number]::-webkit-inner-spin-button {
-webkit-appearance: none;
padding-right: 1.2em;
}
Which method of HTMLCanvasElement is used to represent image of Canvas Element?
toDataURL()====
saveAsImage()
saveFile()
exportImage()
What is the internal/wire format of input type="date" in HTML5?
DD-MM-YYYY
YYYY-MM-DD=====
MM-DD-YYYY
YYYY-DD-MM
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"/>
<input name="pass" type="password" validate="true"/>
<input name="username" validate/>
<input name="pass" type="password" validate/>
There is no way to implement client-side validation for the username and password fields in HTML5.
Which of the following statements are correct with regard to the <hr> and <br> elements of HTML5?
Note: There may be more than one right answer.
The <hr> element acts in the same way as the tab key and the <br> element acts in the same way as the shift key.
The <hr> element is used to insert the horizontal line within the document and the <br> element is used to insert a single line break.=======
The <hr> element is used to put a line across the page and the <br> element acts in the same way as a return/enter key press.
Which of the following is not a valid attribute for the <video> element in HTML5?
controls
autoplay
disabled====
preload
Which of the following <link> attributes are not supported in HTML5?
Note: There may be more than one right answer.
sizes
rev====
rel
charset=====
Which is the standard method for clearing a canvas?
context.clearRect ( x , y , w , h );====
canvas.width = canvas.width;
context.clear();
All of these.
Which of the following input element variations will show a numeric keypad in mobile browsers?
Note: There may be more than one right answer.
<input type="text" pattern="[0-9]*" />
<input type="number" />=======
<input type="text" keyboard="numeric" />
<input type="text" keyboard="number11" />
Which of the following are true regarding the <keygen> tag in HTML5?
Note: There may be more than one right answer.
The <keygen> tag specifies a key-pair generator field used for forms.====
The <keygen> tag generates a public/private key pair and then creates a certificate request. This certificate request will be sent to a Certificate Authority (CA), which then creates a certificate and sends it back to the browser.======
The <keygen> tag generates random passwords when the user requests for a password reset.
The <keygen> tag is deprecated in HTML5.
True or false:
JavaScript objects can be stored directly into localStorage.
True
False====
Which of the following is the correct way to store an object in a localStorage?
localStorage.setItem('testObject', JSON.stringify(testObject))====
localStorage.setItem('testObject', testObject)
localStorage.add('testObject', testObject)
localStorage.addItem('testObject', testObject)
Which of the following is not a valid syntax for the <link> element in HTML5?
<link rel="icon" href="abc.jpg" sizes="16x16">
<link rev="stylesheet" href="abc.css" type="text/css" target="_parent">=====
<link rel="alternate" type="application/pdf" hreflang="fr" href="manual-fr">
Which of the following is a proper syntax for <br> tag as W3C specs for HTML5 defines?
<br />====
<br/>
<br>
<br></br>
Which following are valid default values for the <input type="date"> HTML5 element?
now
2013-05-30====
2013-30-05
today
Which of the following are valid ways to associate custom data with an HTML5 element?
Note: There may be more than one right answer.
<tr class="foo" data-id-type="4">====
<tr class="foo" id-type="4">
<tr class="foo" data-id_type="4">======
All of the above.
What is the limit to the length of HTML attributes?
65536
64
There is no limit.====
None of these.
Which of the following will detect when an HTML5 video has finished playing?
var video = document.getElementsByTagName('video')[0];
video.onended = function(e) {======
}
var video = document.getElementsByTagName('video')[0];
video.onPlayend = function(e) {
}
var video = document.getElementsByTagName('video')[0];
video.onPlayFinish = function(e) {
}
var video = document.getElementsByTagName('video')[0];
video.onPlayBackended = function(e) {
}
Which of the following are true about the ARIA role attribute in HTML5?
Note: There may be more than one right answer.
Every HTML element can have an ARIA role attribute specified.=====
Every HTML element is required have an ARIA role attribute specified.
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.======
There is no ARIA attribute called "role".
Which of the following HTML5 features is capable of taking a screenshot of a web page?
Server-Sent Events
SVG
Canvas====
Web Workers
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>
var context = canvas.getContext();
var context = canvas.getElementById("context");
var context = canvas.getContext("2d");=====
var context = canvas.getElementById("2d");
What is the best way to define the character set of an HTML5 web page?
<meta http-equiv='charset' content='utf-8'>====
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<meta charset='utf-8'>