HTML5 Test
HTML5 Test
to
to
to
to
define
define
define
define
important text.
computer code text.
sample computer code.
a definition term.
Answers:
Drag and drop files from the desktop
Answers:
localStorage.setItem('obj', obj);
localStorage.setItem('obj', JSON.stringify(obj));
localStorage.setItem('testObject',
JSON.parse(testObject));
Answers:
localStorage.setItem(obj);
Answers:
Answers:
isCanvasSupported()
!!document.createElement("canvas")
!isCanvasSupported()
!!window.HTMLCanvasElement
9. Which of the following video file formats
are currently supported by the <video>
element of HTML5?
Answers:
CCTV
MPEG 4
Ogg
3GPP
10. Which of the following shows correct use
of client-side data validation in HTML5, on
username and password fields in particular?
Answers:
sound.begin();
<input name="username" required /> <input
name="pass" type="password" required/>
<input name="username" validate="true"/> <input
name="pass" type="password" validate="true"/>
sound.resume();
sound.start();
sound.play();
onerror
Answers:
onended
controls
onloadeddata
autoplay
onemptied
disabled
preload
12. Consider the following JavaScript code:
var c=document.getElementById("myCanvas");
Answers:
var ctx=c.getContext("2d");
accept
var img=document.getElementById("img");
autofocus
autocomplete
formtarget
rel
charset
Server-Sent Events
SVG
Answers:
Canvas
autocomplete
Web Workers
autofocus
placeholder
Answers:
formnovalidate
HTML5 Canvas can be used to create images.
Answers:
True
False
context.fillStyle = "blue";
context.font = "bold 16px Arial";
context.fillText("Zibri", 100, 100);
</script>
sizes
Answers:
rev
var context = canvas.getContext();
Answers:
<video allowFullScreen="true">
Answers:
None of these.
toDataURL()
saveAsImage()
saveFile()
exportImage()
28. Can we store JavaScript Objects directly
into localStorage?
Answers:
Yes
No
29. Once an application is offline, it
remains cached until the following happens
(select all that apply):
Answers:
The application cache is programmatically updated.
Answers:
_blank
_self
_top
_bottom
DD-MM-YYYY
YYYY-MM-DD
MM-DD-YYYY
YYYY-DD-MM
Answers:
<tr class="foo" data-id-type="4">
Answers:
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) { }
32. What is the difference between ServerSent Events (SSEs) and WebSockets in HTML5?
Answers:
Calling the JavaScript getWidth() function.
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.
33. Which of the following methods can be
used to estimate page load times?
Answers:
Using _gaq.push(['_trackPageLoadTime']) with
Google Analytics.
Using the Navigation Timing JavaScript API.
Page load times cannot be estimated.
<script>
var canvas = document.getElementById("e");
//insert code here
context.fillStyle = "blue";
Answers:
onstalled
onwaiting
onsuspend
oninvalid
41. Which of the following is the correct way
to check browser support for WebSocket?
Answers:
console.log(WebSocket ? 'supported' : 'not
supported');
console.log(window.WebSocket ? 'supported' : 'not
supported');
console.log(window[WebSocket] ? 'supported' : 'not
supported');
console.log(window['WebSocket'] ? 'supported' :
'not supported');
42. Which of the following is the correct way
to store an object in a localStorage?
Answers:
localStorage.setItem('testObject',
JSON.stringify(testObject))
localStorage.setItem('testObject', testObject)
localStorage.add('testObject', testObject)
localStorage.addItem('testObject', testObject)
43. Which of the following is the correct way
to play an audio file in HTML5?
Answers:
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.
Answers:
<!doctype html>
<!DOCTYPE html>
<!DOCTYPE HTML5>
<!DOCTYPE HTML>
45. 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
[email protected]?
Answers:
play
loop
Answers:
mute
<a
href="mailto:[email protected]">webmaste
r</a>
pause
<a
href="[email protected]">webmaster</a>
<a
http="mail:[email protected]">webmaster
</a>
<mail
http="send:[email protected]">webmaster
</mail>
Answers:
Polling URLs in background
Answers:
now
2013-05-30
All of these.
2013-30-05
today
Answers:
Every HTML element can have an ARIA role
attribute specified.
button
command
checkbox
radio
56. Which event is fired when an element
loses its focus in an HTML5 document?
Answers:
onfocus
onload
onblur
onselect
57. What is the purpose of the <q> element in
HTML5?
Answers:
It is used to define the start of a term in a definition
list.
foo&&& bar
context.clearRect ( x , y , w , h );
<option value="89">Item 1</option>
canvas.width = canvas.width;
context.clear();
All of these.
55. In HTML5, which of the following is not a
valid value for the type attribute when used
with the <command> tag shown below?
90
Item 1
Item 2
59. Which of the following is the best method
to store an array in localStorage?
Answers:
var localStorage[names]=new Array();
localStorage.names[0]=prompt("New member
name?");
var names = []; names[0] = prompt("New member
name?"); localStorage["names"] =