Educate yourself online!

Attention!

For new updates please visit http://www.shortquiz.blogspot.com


HTML 5 Test

By on 00:10

HTML5 Test




Which of the following < iframe > attributes are NOT supported in HTML 5.0?

a: height
b. marginheight
c. sanbox
d. scrolling

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.
c. Page load times cannot be estimated.
d. Using built-in JavaScript methods.


Can we store JavaScript Objects directly into localStorage?

a. Yes
b. No

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
c. Ogg
d. 3GPP

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.
d. A button tag can include images as well.

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.
b. The application cache gets automatically cleared by the browser.
c. The manifest file is modified.
d. 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 };

a. localStorage.setItem('obj', obj);
b. localStorage.setItem('obj', JSON.stringify(obj));
c. localStorage.setItem('testObject', JSON.parse(testObject));
d. localStorage.setItem(obj);

Which event is fired when an element loses its focus in an HTML5 document?

a. onfocus
b. onload
c. onblur
d. onselect

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.
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.

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
b. _self
c. _top
d. _bottom

Consider the following JavaScript code:

var c=document.getElementById("myCanvas");
var ctx=c.getContext("2d");
var img=document.getElementById("img");

a. Which method will correctly draw an image in the x=10, y=10 position?
b. ctx.drawImage(img,10,10);
c. context.drawImage(img,20,10,10,10);
d. context.drawImage(img,10,20,10,10,20,20,10,10);
e. All of these

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.
c. It gets fired at the end of a drag operation.
d. It gets fired while an element is being dragged.

Which of the following is not a valid attribute for the <video> element in HTML5?

a. controls
b. autoplay
c. disabled
d. preload

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.
c. Communication does not rely on a shared relay server in the network.

True or false:

JavaScript objects can be stored directly into localStorage.

a. True
b. False

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;
      }

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;
      }


What is the internal/wire format of input type="date" in HTML5?

a. DD-MM-YYYY
b. YYYY-MM-DD
c. MM-DD-YYYY
d. YYYY-DD-MM

How can audio files be played in HTML5?

a. var sound = new Audio("file.wav");
b. sound.begin();
c. sound.resume();
d. sound.start();
e. sound.play();

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">
b. <tr class="foo" id-type="4">
c. <tr class="foo" data-id_type="4">
d. All of the above.

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>
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>

Which HTML5 doctype declarations are correct?

Note: There may be more than one right answer.

a. <!doctype html>
b. <!DOCTYPE html>
c. <!DOCTYPE HTML5>
d. <!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?

a. accept
b. autofocus
c. autocomplete
d. formtarget

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");
d. var context = canvas.getElementById("2d");


The following are valid use cases of client file/directory access in HTML5, except:

a. Drag and drop of files from the desktop
b. Full file system access
c. Use of the HTML5 File API
d. Use of files as HTML5 input types

Which of the following will detect when an HTML5 video has finished playing?

a. var video = document.getElementsByTagName('video')[0];
      video.onended = function(e) {
      }

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) {
      }

Which media event is triggered when there is an error in fetching media data in HTML5?

a. onstalled
b. onwaiting
c. onsuspend
d. oninvalid

Which of the following is the correct way to store an object in a localStorage?

a. localStorage.setItem('testObject', JSON.stringify(testObject))
b. localStorage.setItem('testObject', testObject)
c. localStorage.add('testObject', testObject)
d. localStorage.addItem('testObject', testObject)

What is the purpose of the <q> element in HTML5?

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.
d. It is used to define what to show browsers that do not support the ruby element.

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.
d. It is triggered when the window becomes visible.


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.
d. All of the above.

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 be alert saying “[object Window]” when the document is loaded.
c. It w]ll 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.

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

What will be the result if you use the following code to your HTML 5.0 document?

< p >! Use < del > MAC< /del > < ins >Microsoft< /ins >!< /p > /p >

a. I use MAC Microsoft !
b. I use MAC Microsoft !
c. I use MAC Microsoft !
d. I use MAC Microsoft !

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. The script will be executed asynchronously, as soon as it is available.

Which of the following is an INVALID value for the type attribute of command tag?

a. checkbox
b. radio
c. command
d. text

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.
c. It will open the site msdn.com in a frame below.
d. It will not be clickable as it is not formed correctly.

Which of the following are valid HTML 5.0 elements?

a. < canvas >
b. < summary >
c. < aside >
d. < video >
e. All are correct

Which of the following is correct with regard to the on can play through even 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. The script will run when media data is loaded.
d. The script will run when the length of the media is changed.

Which of the following is not a valid input type of the form tag?

a. checkbox
b. image
c. hidden
d. button
e. All are valid

The following link is placed on an HTML webpage.

< a href=http://msdn.com/ target=”_blank” < /a >
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 >

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.
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.

How will you change the value of the cookies and items in the Storage objects of the local Storage attributes in HTML 5.0?

a. By invoking the window.dialogArguments() API method.
b. By invoking the window. navigator.yieldForStorageUpdates() API method.
c. By invoking the window.navigator.appName API method.

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

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

While rendering your HTML 5.0 web page, which of the following < link > element files will get skipped by a complaint 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”
c. None of the above

Which of the following are valid mouse events in HTML 5.0?

a. ondblclick
b. ondragstart
c. ondragenter
d. onscroll
e. ondrop
f. All are correct

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. None of the above

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" >

What is the default background color for the canvas element in HTML 5.0?
:
a. Black
b. White
c. Transparent
d. Gray

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

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. None of the above

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 >
Options:

a. button
b. command
c. checkbox
d. radio

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.
c. It triggers an event when the cache content has been updated.
d. It updates the cache for the current document in the background.

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.

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

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
c. Item 1
d. Item 2

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

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

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. It is used to define the restrictions to the frame content.
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.

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

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

Which tag event is fired when the user leaves the document?

a: onunload
b. onundo
c. onredo
d. onerror

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

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 >

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

0 comments:

Post a Comment