Saturday, February 15, 2020
Page 1 of 24
Fiverr HTML5 Test Answers
https://www.fiverr.com/roobon
1. 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?
o <tr>
<th>Customer Name</th>
<th rowspan=3>Contact</th>
</tr>
o <tr>
<th>Customer Name</th>
<th colspan=3>Contact</th>
</tr>
o <tr>
<th>Customer Name</th>
<th cellpadding=3>Contact</th>
</tr>
o <tr>
<th>Customer Name</th>
<th cellspacing=3>Contact</th>
</tr>
https://code.sololearn.com/W1d0TkKGiQyp
2. What is the default background color for the canvas element in HTML 5.0?
Black
White
Transparent
Gray
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_canvas
Saturday, February 15, 2020
Page 2 of 24
3. Which of the following is NOT a valid attribute for the <link> element in HTML 5.0?
hreflang
rel
http-equiv
media
https://www.w3schools.com/tags/tag_link.asp
4. Which of the following HTML 5.0 elements is used to embed Java applets into your HTML 5.0
web page?
<applet>
<object>
<source>
<progress>
https://www.w3schools.com/tags/tag_object.asp
5. 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.
6. Which form event is fired on the click of a button using a button tag with its type attribute
value equal to submit?
onload
onsubmit
onunload
onreset
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onsubmit
7. How will you return a reference to the parent of the current window or subframe in an HTML
5.0 web application?
window.top
window.parent
window.frameElement
None of the above
https://developer.mozilla.org/en-US/docs/Web/API/Window/parent
Saturday, February 15, 2020
Page 3 of 24
8. Which of the following attributes comes in handy when borders have to be put between groups
of columns instead of every column?
col
colgroup
rowspan
row
https://www.w3schools.com/tags/tag_colgroup.asp
9. Which of the following video file formats are currently supported by the <video> element of
HTML 5.0?
CCTV
MPEG 4
Ogg
3GPP
https://www.w3schools.com/html/html5_video.asp
10. This question is based upon the figure shown below
<html>
<body>
<script type='text/javascript’>
function dosomething(e) {
if (!e) var e = window.event;
alert(e.type);
}
</script>
<form>
Numbers only: <input type=’text’ id=’number’/>
<input type=’button* onclick="dosomething(document:gateElementByld('number *))"
value=’checkfield’ />
</form>
</body>
</htmi>
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?
number
text
button
None of the above
https://code.sololearn.com/WBMBrR1ajfn8
Saturday, February 15, 2020
Page 4 of 24
11. Which of the following statements is correct if you allow the user to select only one radio button
from a group of radio buttons?
The name of the input tag must be the same for all the radio buttons.
The value of the input tag must be the same for all the radio buttons.
The display text of the input tag must be the same for all the radio buttons.
All the radio buttons must be added to the same group using the <optgroup> tag.
12. 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>
.tnemucod ruoy ot nettirw eb dluohs taht txet emos si ereH
Here is some text that should be written to your document.
Here is some text that should be written to your document.
None of the above.
13. 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.
<body backcolor=”Yellow”>
<body background=”Yellow”>
<body bgcolor=”Yellow”>
<body color=”Yellow”>
14. Which of the following is an INVALID value for the type attribute of command tag?
checkbox
radio
command
text
15. 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 href=”././Products.html”> All Products </a>
<a href=”../../Products.html”> All Products </a>
<a href=”…/…/Products.html”> All Products </a>
<a href=”../Products.html”> All Products </a>
<a href=”Products.html”> All Products</a>
Saturday, February 15, 2020
Page 5 of 24
16. 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>
I use MAC Microsoft!
I use MAC Microsoft!
I use MAC Microsoft!
I use MAC Microsoft!
17. Which of the following is the correct syntax to define a charset in the HTML 5 <meta>
element?
<meta http-equiv=”content-type” content=”text/html; charset=ISO-8859-1″>
<meta charset=”ISO-8859-1″>
Neither a nor b.
18. Which of the following is NOT a supported attribute of the <ol> element in HTML 5.0?
type
reversed
start
compact
https://www.w3schools.com/tags/tag_ol.asp
19. Which of the following is a valid attribute for the <colgroup> element in an HTML 5.0
document?
char
span
align
width
20. Which <body> tag event is fired when the user leaves the document?
onunload
onundo
onredo
onerror
21. Which of the following are INVALID keyword values for http-equiv attribute when used with
the <meta> element in HTML 5.0?
content-type
expires
set-cookie
keywords
refresh
author
https://www.w3schools.com/tags/att_meta_http_equiv.asp
Saturday, February 15, 2020
Page 6 of 24
22. A computer programming book has to go online. Which of the following tags is ideal for
displaying the program snippets?
<emp>
<code>
<dfn>
<cite>
https://www.w3schools.com/html/tryit.asp?filename=tryhtml_formatting_intro3
23. Which of the following is NOT a valid value for the type attribute of the <input> element in
HTML 5.0?
url
week
tel
radio
datetime-local
All of the above are the valid values for <input> element
https://www.w3schools.com/tags/tag_input.asp
24. What is the role of the <dfn> element in HTML 5.0?
It is used to define important text.
It is used to define computer code text.
It is used to define sample computer code.
It is used to define a definition term
25. Which of the following is NOT a valid syntax for the <link> element in HTML 5.0?
<link rel=”icon” href=”abc.jpg” sizes=”16×16″>
<link rev=”stylesheet” href=”abc.css” type=”text/css” target=”_parent”>
<link rel=”alternate” type=”application/pdf” hreflang=”fr” href=”manual-fr”>
https://www.w3schools.com/tags/tag_link.asp
26. Which of the following are valid HTML 5.0 elements?
<canvas>
<summary>
<aside>
<video>
27. Which of the following is NOT a valid syntax for the element in HTML 5.0?
<h1 class="cheader"> This is header 1 </h1 >
<h1 align=”center”> This is header 1</h1>
<h1 onClick=”dothis(‘sc1′)” >This is header </h1>
<h1 style=”cursor:auto;”>This is header </h1>
Saturday, February 15, 2020
Page 7 of 24
28. Which of the following statements are correct with regard to <hr> and <br> elements of HTML
5.0?
<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.
<hr> element is used to insert the horizontal line within your document and <br> element is used
to insert a single line break.
<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.
29. What will be the return value when using the window.navigator.appName API method in an
HTML 5.0 web application?
It will return the version of the browser.
It will return the complete User-Agent header.
It will return the name of the platform.
It will return the name of the browser.
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_nav_appname
30. Which of the following languages will you use to paint the graphics designed using the HTML
5.0 <canvas> tag?
o VB script
o JavaScript
o PostScript
o None of the above
https://www.w3schools.com/html/html5_canvas.asp
31. Which <iframe> attribute is used to define the restrictions to the frame content in HTML 5.0?
seamless
sandbox
srcdoc
32. In HTML 5.0, what is the function of the sandbox attribute when used with <iframe> as shown
below?
<iframe src=”aaa ” sandbox=?></iframe>
It is used to define the restrictions to the frame content.
It is used to define the URL of the document that should appear in the iframe.
It is used to specify that an iframe should appear as if it is part of the document the iframe is in.
https://www.w3schools.com/tags/att_iframe_sandbox.asp
33. Which of the following statements is correct for a blockquote?
It makes the text a bit bigger for emphasizing.
It defines a section that is quoted from the another source
It makes the text slightly bolder.
Saturday, February 15, 2020
Page 8 of 24
34. Which event is fired when the history of the browser window changes?
onpopstate
onstorage
onresize
onhashchange
https://www.w3schools.com/jsref/obj_popstateevent.asp
35. When does the ondragleave mouse event get fired in HTML 5.0?
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.
36. Which of the following are valid mouse events in HTML 5.0?
ondblclick
ondragstart
ondragenter
onscroll
ondrop
37. Which of the following <iframe> attributes are NOT supported in HTML 5.0?
height
marginheight
sandbox
scrolling
38. In HTML 5.0, which of the following attributes of the <object> element refers to the location of
the object’s data?
type
codebase
data
usemap
https://www.w3schools.com/tags/tag_object.asp
39. Which of the following is an INVALID parameter for the
window.navigator.registerContentHandler API method in an HTML 5.0 web application?
url
mimeType
scheme
title
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerContentHandler
Saturday, February 15, 2020
Page 9 of 24
40. When is the window onstorage event triggered in the HTML document?
It is triggered when the window is resized.
It is triggered when a Web Storage area is updated.
It is triggered when a document performs an undo function.
It is triggered when the window becomes visible.
https://www.w3schools.com/tags/ref_attributes.asp
41. 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>
The script is fetched and executed immediately, before the user agent continues parsing the page.
The script will be executed when the page has finished parsing.
The script will be executed asynchronously, as soon as it is available.
42. Which of the following is correct with regard to the oncanplaythrough event fired by media
resources in the HTML 5.0 document?
The script will run when the media has reached the end.
The script will run when the media is played to the end, without stopping for buffering.
The script will run when media data is loaded.
The script will run when the length of the media is changed.
43. What is the output when you use the HTML 5.0 code snippet shown below?
<body onload=”alert(this)”>
It will alert saying “[object HTMLBodyElement]” when the document is loaded.
It will alert saying “[object Window]” when the document is loaded.
It will alert saying “[this]” when the document is loaded.
The alert message is not properly defined in the body element and an error will be generated when
the document is loaded.
44. Which of the following represents INVALID syntax for defining an attribute value in an
HTML 5.0 document?
<input name =’be evil’ />
<input name= be evil/>
<input name = “be-evil” />
All of the above.
45. What is the purpose of the <q> element in HTML 5.0?
It is used to define the start of a term in a definition list.
It is used to define attribute values for one or more columns in a table.
It is used to define the start of a short quotation
It is used to define what to show browsers that do not support the ruby element.
46. How will you cancel the timeouts that are set with the setInterval() API method identified by
the handlers in HTML 5.0?
window.clearInterval (handle)
window.clearTimeout (handle)
window.setInterval (code, timeout)
window.setTimeout (code, timeout)
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_setinterval
Saturday, February 15, 2020
Page 10 of 24
47. Which of the following tags would assist in creating named groups within a select list?
opt
group
optgroup
selectgroup
48. 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?
accept
autofocus
autocomplete
formtarget
49. Which HTML 5.0 element will you use to group the related options in a drop-down list?
optgroup
option
menu
var
nav
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_optgroup
50. This question is based upon the figure shown below
Saturday, February 15, 2020
Page 11 of 24
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?
User should define an accept attribute to the input element whose type is url.
User should define multiple attribute to the input element whose type is url.
User should define a list attribute to the input element whose type is url.
User should define a placeholder attribute to the input element whose type is url.
51. What does the icon attribute of the HTML 5.0 command tag define?
<command icon=”?”>Click Me!</command>
It is used to define the URL of an image to display as the command.
It is used to define the name of the radiogroup this command belongs to.
It is used to define if the command is checked or not.
It is used to define if the command is available or not.
https://www.w3schools.com/tags/att_command_icon.asp
52. 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?
td
p
ls
pre
53. Which event is fired when an element loses its focus in HTML 5.0 document?
onfocus
onload
onblur
onselect
54. What is the purpose of the <keygen> element in HTML 5.0?
It is used to define a keyboard text in an HTML 5.0 web page.
It is used to generate a public-private key pair in an HTML 5.0 web page.
It is used to define a definition term in an HTML 5.0 web page.
It is used to define a variable in an HTML 5.0 web page.
https://www.tutorialrepublic.com/html-reference/html5-keygen-tag.php
55. Which of the following is NOT a valid attribute for the <video> element in HTML 5.0?
controls
autoplay
disabled
preload
https://www.w3schools.com/tags/tag_video.asp
Saturday, February 15, 2020
Page 12 of 24
56. 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 link element whose href is “B”
A link element whose href is “A”
None of the above
57. Which of the following is NOT an attribute of the <meta> element in HTML 5.0?
charset
content
http-equiv
scheme
https://www.w3schools.com/tags/tag_meta.asp
58. Which of the following is NOT a valid value for the <iframe> sandbox attribute in HTML 5.0?
url
allow-scripts
allow-same-origin
allow-forms
https://www.w3schools.com/tags/att_iframe_sandbox.asp
59. What is the function of onobsolete, an application cache API method in HTML 5.0?
It reflows the HTML document using updated cached content.
It triggers an event when the cache content has been marked as obsolete.
It triggers an event when the cache content has been updated.
It updates the cache for the current document in the background.
60. 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?
<html>
<body>
<script>
var newText=document.createElement("anew");
var node=document.createTextNode("New Line.");
newText.appendChild(node);
var element=document.getElementById("Firstdiv");
var newchild=document.getElementById("a2");
element.insertBefore(newText,newchild);
</script>
Saturday, February 15, 2020
Page 13 of 24
<div id="Firstdiv">
<p id="a1">First Line.</p>
<p id="a2">Second Line.</p>
</div>
</body>
</html>
<html>
<body>
<div id="Firstdiv">
<p id="a1">First Line.</p>
<p id="a2">Second Line.</p>
</div>
<script>
var newText=document.createElement("anew");
var node=document.createTextNode("New Line.");
newText.appendChild(node);
var element=document.getElementById("Firstdiv");
var newchild=document.getElementById("a2");
element.insertBefore(newText,newchild);
</script>
</body>
</html>
<html>
<body>
<div id="Firstdiv">
<p id="a1">First Line.</p>
<p id="a2">Second Line.</p>
</div>
<script>
var newText=document.createElement("anew");
var node=document.createTextNode("New Line.");
newText.appendChild(node);
var element=document.getElementById("Firstdiv");
element.appendChild(newText);
</script>
</body>
</html>
https://code.sololearn.com/WGpm0S0q7fa4
Saturday, February 15, 2020
Page 14 of 24
61. A developer wrote image tag:
<img src ="states.gif" width ="330" height ="406" alt="States"
usemap ="#statemap" />
What code should follow this?
<map id ="statemap" name="statemap">
<area shape ="rect" coords ="0,0,82,126" href="/state1.htm"
alt="State1" />
</map>
<map id ="statemap" name="statemap"></map>
<area shape ="rect" coords ="0,0,82,126" href="/state1.htm" alt="State1" />
<map id ="statemap" name="statemap">
<imgarea shape ="rect" coords ="0,0,82,126" href="/state1.htm" alt="State1" /></map>
<map id ="statemap" name="statemap"></map>
<imgarea shape ="rect" coords ="0,0,82,126" href="/state1.htm" alt="State1" />
62. What will be the output of the following HTML DOM code?
<!DOCTYPE html>
<html><body>
<p id="begins">First Attempt! </p>
<script>
var txt=document.getElementById("begins").innerHTML;
</script>
</body></html>
First Attempt!
First Attempt!
First Attempt!
First Attempt!
null
First Attempt!
begins
blank, nothing will appear on screen
https://code.sololearn.com/WP3NJnY3Q9N1
63. Which of the following is the correct method to change the background color to indigo with
help of a button?
<!DOCTYPE html>
<html>
<body>
<script>
function ChangeBackground()
{
Saturday, February 15, 2020
Page 15 of 24
document.backgroundColor="Indigo";
}
</script>
<input type="button" value="New Color" onclick="ChangeBackground()"/>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<input type="button" value="New Color" onclick="ChangeBackground()"/>
<script>
function ChangeBackground()
{
document.body.style.backgroundColor="Indigo";
}
</script>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<script>
function ChangeBackground()
{
document.new.backgroundColor="Indigo";
}
</script>
<input type="button" value="New Color" onclick="ChangeBackground()"/>
</body>
</html>
None of the above
https://code.sololearn.com/W1KJQcooIT7t
64. Which of the following is the correct syntax to change the text 'WELCOME!' to 'Hello!'?
<h1 onclick=='WELCOME!'>Hello! </h1>
<h1 onclick. innerHTML=='Hello!'>WELCOME! </h1>
<h1 onclick="this.innerHTML='Hello!'">WELCOME! </h1>
<h1 onclick="this.innerHTML='WELCOME!', 'Hello!' </h1>
https://code.sololearn.com/WTqZuVP1szkS
Saturday, February 15, 2020
Page 16 of 24
65. 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 webmasterOxcompany.com?
<a href="mailto:webmasterOxcompany.com">webmaster</a>
<a href="/webmasterOxcompany.com">webmaster</a>
<a http="mail:webmasterOxcompany.com">webmaster</a>
<mail http="send:webmasterOxcompany.com">webmaster</mail>
<a href="mailto://webmasterOxcompany.com">webmaster</a>
66. Suppose you want to display certain text , for example, "First Program !"in red color and times
new roman font family on the screen. Which of the following is the correct syntax to do so?
<!DOCTYPE html>
<html><body>
<p id="p1">First program!</p>
<script>
document.getElementByld("p1").style.color="red";
document.getElementByld("p1").style.fontFamily=Times newroman";
</script><body><html>
<!DOCTYPE html>
<html><body>
<p id="p1 ">First program!</p>
<script>
document.getElementByld("p1").style.color="red" && style.fontFamily="Times new roman";
</script><body><html>
<!DOCTYPE html>
<html>
<body>
<p id="p1 ">First program!</p>
<script>
document.getElementByld("p1")color="red" && fontFamily="Times new roman";
</script><body><html>
None of the above
67.
The name property of "Element"node shown in figure will return ____________________.
Saturday, February 15, 2020
Page 17 of 24
tag name
name of node
name of element
value of element
https://www.w3schools.com/jsref/prop_node_nodename.asp
https://www.w3schools.com/js/js_htmldom_navigation.asp
68. Which of the following is/are the correct method/s to access HTML element?
getElementById()
getElementsByTagName()
getElementsByClassName()
All of the above
69. Which of the following is an obsolete attribute of the <ol> element in HTML 5.0?
type
reversed
start
compact
70. Which of the following is true about HTML DOM?
i) It is a standard object model for HTML
ii) It is a programming language.
iii) It is a standard programming interface for HTML.
i & ii
i & iii
ii & iii
All of the above
None of the above
https://www.w3schools.com/whatis/whatis_htmldom.asp
71. My favorite color is blue red!
Which piece of code will you use in your HTML 5.0 document to get the output as shown in the
image?
<p>My favorite color is <del>blue</del> <ins>red</ins>!</p>
<p>My favorite color is <s>blue</s> red</p>
<p>My favorite color is <strike>blue</strike> red!</p>
<p>My favorite color is <del>blue</del> red!</pxbr>
72. Consider the above code. What will be the impact upon the contents of the element if both the
style sheets define the same class?
<html>
<head>
<title>untitled Page</title>
<link rel=stylesheet href=style.css />
Saturday, February 15, 2020
Page 18 of 24
<link rel=stylesheet href=stylel1.css />
</head>
<body>
<span class="heading">Text goes here.......</span>
</body>
</html>
style.css
.heading
{
font-family:verdana;
font-style:normal;
font-weight:bold;
font-size:11pt;
color:Red;
}
stvle1.css
.heading
{ font-family:verdana;
font-style:normal;
font-weight:bold;
font-size:llpt;
color:Blue;
}
The contents of the element will be of red color and will inherit all the effects of style.css.
The contents of the element will be of blue color and will inherit all the effects of style 1.css.
The contents of the element will be of white color and will inherit all the effects of style.css and
style 1 .css.
None of the style effects will be applied to the contents of the element.
73. 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?
89
90
Item 1
Item 2
74. What will be the output of following HTML code?
<!DOCTYPE html>
<html>
<body>
<p id="p1">First Program!</p>
<script>
document.getElementById("p1").innerHTML="New text!";
</script>
Saturday, February 15, 2020
Page 19 of 24
</body>
</html>
First Program!
First Program!
null
First Program!
New text!
New text!
New text!
null
https://code.sololearn.com/W2Bf10qX93lU
75. 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);
</script>
</body>
</html>
First Attempt!
First Attempt!
First Attempt!
First Attempt!
null
No output
https://code.sololearn.com/WlyttI9T73tg
76. Which of the following are valid values for the contenteditable attribute of the <figure> element in
HTML 5.0?
True
False
0
1
Saturday, February 15, 2020
Page 20 of 24
77. The following link is placed on an HTML webpage
<a href=”http://msdn.com” target=”_blank” >MSDN</a>
What do you infer from it?
It will open the site msdn.com in the same window.
It will open the site msdn.com in a new window.
It will open the site msdn.com in a frame below.
It will not be clickable as it is not formed correctly.
78. Which media event will be fired when a media resource element suddenly becomes empty?
Onerror
Onended
Onloadeddata
Onemptied
https://www.w3schools.com/tags/att_onemptied.asp
79. Which of the following options are the correct semantic elements?
<div>
<article>
<form>
<table>
80. In HTML 5.0, which of the following media events is triggered when fetching of media data is
interrupted before it having completely loaded (due to any reason)?
onstalled
onwaiting
onsuspend
oninvalid
https://www.w3schools.com/jsref/event_onsuspend.asp
https://www.w3schools.com/jsref/event_onwaiting.asp
https://www.w3schools.com/jsref/event_onstalled.asp
81. For adding a new child node before a specified child node, which of the following methods is
used?
insertBefore()
replaceChild()
appendChild()
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_node_insertbefore
Saturday, February 15, 2020
Page 21 of 24
82. Which of the following statements is correct if you invoke the window.prompt (message,
default) web application API method in HTML 5.0?
It will only show the modal text field prompt with the given message to the user.
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.
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.
Both b and c.
https://www.w3schools.com/jsref/met_win_prompt.asp
83. Which of the following events is NOT supported in HTML 5.0?
oninput
oninvalid
ondrop
onreset
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_oninput
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_ev_onreset
https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_oninvalid
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_ev_ondrop
All are supported in HTML 5
84. You specified a base tag and anchors as follows:
1. <base target=”_blank”>
2. <a href=”http://www.yahoo.com”>Yahoo</a>
3. <a href=”http://www.google.com” target=”_top”>Google</a>
Which of the following is true of the above code?
Only the Yahoo link will open in a new window.
Only the Google link will open in a new window.
Both links will open in a new window.
Both links will open in the same window.
https://code.sololearn.com/WfapcDK73nnL
Note: Yahoo open in a new window and Google open in same window
85. In which of the following conditions is a browsing context A allowed to navigate a second
browsing context B?
When the browsing context A is a nested browsing context and its top-level browsing context is B.
When the browsing context B is an auxiliary browsing context and A is allowed to navigate B’s
opener browsing context.
The origin of the active document of A is the same as the origin of the active document of B.
All of the above
Saturday, February 15, 2020
Page 22 of 24
86. This question is based upon the figure shown below
Suppose you placed four radio buttons on a web form. Which of the following statements is
correct for the code shown above?
Male: <input type-,radio,,checked="checked" name-'chk”value="male">
Female <input type-’radio” name="chk" value-’fern ale“>
Married <input type-’radio" checked-’checked” name-’chk" value-’married">
Single: <input type= "radio” name-’chk" value="single">
The user can choose only the male and the married options.
The user can choose only the female and single options.
The user can choose only one option out of the four.
The user can choose all the four options at the same time.
The user can choose one option from Male/Female and one from Married/Single.
https://code.sololearn.com/WWEQQvkTP5o8
87. What is the function of the history traversal task source in HTML 5.0?
It is used for features that react to user interaction, for example, keyboard or mouse input.
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.
It is used to queue calls to history.back() and similar APIs.
All of the above.
88. Which of the following is the correct method to load another web page or reload the same page
in HTML 5.0?
<head>
<meta http-equiv=refresh content=5>
</head>
<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>
Saturday, February 15, 2020
Page 23 of 24
<head>
<meta http-equiv=refresh content=”5;URL=http://yahoo.com >
</head>
All of the above
https://code.sololearn.com/WY3ZnWBQ5DqZ
89. Which of the following elements preserves spaces and line breaks, and displays the text in fixed-
width font?
<xmp>
<pre>
<p>
<q>
<br>
https://www.w3schools.com/tags/tag_pre.asp
90. How will you change the value of the cookies and items in the Storage objects of the
localStorage attributes in HTML 5.0?
By invoking the window.dialogArguments() API method.
By invoking the window. navigator.yieldForStorageUpdates() API method.
By invoking the window.navigator.appName API method.
91. 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>
The target URL will open in the parent document.
The target URL will open in a new window.
The target URL will open in the same document in which it was clicked.
The target URL will open in the full body of the window.
https://www.w3schools.com/tags/att_a_target.asp
92. What will be the browsing context if the browsing context name is _top when the HTML 5.0
web page is loading?
It will put the new document in the same window and frame as the current document.
It will load the linked document in the topmost frame.
It is used in the situation where a frameset file is nested inside another frameset file.
Both a and c.
Note: Green marked – 100% ok, Yellow marked – Confused
Saturday, February 15, 2020
Page 24 of 24
Thanks for studying my document.
Syed Ziaul Habib
Professional Tech Trainer and Web Programmer
The Computer Limited
Naya Paltan, Scout Market, Dhaka
Bangladesh
roobon@gmail.com
www.szhabib.com, www.phpmysqlprojects.com
88/1 Distilary Road, Namapara, Gandaria, Dhaka
Exam Result:
Masum scored 9.0 https://youtu.be/4ziLGqlZRgs
Minar scored 8.2: https://youtu.be/roVICloz9rs
Hasib scored 9.0: https://youtu.be/PQrHiqStd14
Resources:
http://upwork-test.pe.hu/html5-fiverr-test
https://www.youtube.com/watch?v=aQ09t0c0AJ0
https://webcoachbd.wordpress.com/2014/03/16/odesk-test-html5-answers/

Fiverr html5 test answers 2020

  • 1.
    Saturday, February 15,2020 Page 1 of 24 Fiverr HTML5 Test Answers https://www.fiverr.com/roobon 1. 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? o <tr> <th>Customer Name</th> <th rowspan=3>Contact</th> </tr> o <tr> <th>Customer Name</th> <th colspan=3>Contact</th> </tr> o <tr> <th>Customer Name</th> <th cellpadding=3>Contact</th> </tr> o <tr> <th>Customer Name</th> <th cellspacing=3>Contact</th> </tr> https://code.sololearn.com/W1d0TkKGiQyp 2. What is the default background color for the canvas element in HTML 5.0? Black White Transparent Gray https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_canvas
  • 2.
    Saturday, February 15,2020 Page 2 of 24 3. Which of the following is NOT a valid attribute for the <link> element in HTML 5.0? hreflang rel http-equiv media https://www.w3schools.com/tags/tag_link.asp 4. Which of the following HTML 5.0 elements is used to embed Java applets into your HTML 5.0 web page? <applet> <object> <source> <progress> https://www.w3schools.com/tags/tag_object.asp 5. 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. 6. Which form event is fired on the click of a button using a button tag with its type attribute value equal to submit? onload onsubmit onunload onreset https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onsubmit 7. How will you return a reference to the parent of the current window or subframe in an HTML 5.0 web application? window.top window.parent window.frameElement None of the above https://developer.mozilla.org/en-US/docs/Web/API/Window/parent
  • 3.
    Saturday, February 15,2020 Page 3 of 24 8. Which of the following attributes comes in handy when borders have to be put between groups of columns instead of every column? col colgroup rowspan row https://www.w3schools.com/tags/tag_colgroup.asp 9. Which of the following video file formats are currently supported by the <video> element of HTML 5.0? CCTV MPEG 4 Ogg 3GPP https://www.w3schools.com/html/html5_video.asp 10. This question is based upon the figure shown below <html> <body> <script type='text/javascript’> function dosomething(e) { if (!e) var e = window.event; alert(e.type); } </script> <form> Numbers only: <input type=’text’ id=’number’/> <input type=’button* onclick="dosomething(document:gateElementByld('number *))" value=’checkfield’ /> </form> </body> </htmi> 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? number text button None of the above https://code.sololearn.com/WBMBrR1ajfn8
  • 4.
    Saturday, February 15,2020 Page 4 of 24 11. Which of the following statements is correct if you allow the user to select only one radio button from a group of radio buttons? The name of the input tag must be the same for all the radio buttons. The value of the input tag must be the same for all the radio buttons. The display text of the input tag must be the same for all the radio buttons. All the radio buttons must be added to the same group using the <optgroup> tag. 12. 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> .tnemucod ruoy ot nettirw eb dluohs taht txet emos si ereH Here is some text that should be written to your document. Here is some text that should be written to your document. None of the above. 13. 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. <body backcolor=”Yellow”> <body background=”Yellow”> <body bgcolor=”Yellow”> <body color=”Yellow”> 14. Which of the following is an INVALID value for the type attribute of command tag? checkbox radio command text 15. 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 href=”././Products.html”> All Products </a> <a href=”../../Products.html”> All Products </a> <a href=”…/…/Products.html”> All Products </a> <a href=”../Products.html”> All Products </a> <a href=”Products.html”> All Products</a>
  • 5.
    Saturday, February 15,2020 Page 5 of 24 16. 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> I use MAC Microsoft! I use MAC Microsoft! I use MAC Microsoft! I use MAC Microsoft! 17. Which of the following is the correct syntax to define a charset in the HTML 5 <meta> element? <meta http-equiv=”content-type” content=”text/html; charset=ISO-8859-1″> <meta charset=”ISO-8859-1″> Neither a nor b. 18. Which of the following is NOT a supported attribute of the <ol> element in HTML 5.0? type reversed start compact https://www.w3schools.com/tags/tag_ol.asp 19. Which of the following is a valid attribute for the <colgroup> element in an HTML 5.0 document? char span align width 20. Which <body> tag event is fired when the user leaves the document? onunload onundo onredo onerror 21. Which of the following are INVALID keyword values for http-equiv attribute when used with the <meta> element in HTML 5.0? content-type expires set-cookie keywords refresh author https://www.w3schools.com/tags/att_meta_http_equiv.asp
  • 6.
    Saturday, February 15,2020 Page 6 of 24 22. A computer programming book has to go online. Which of the following tags is ideal for displaying the program snippets? <emp> <code> <dfn> <cite> https://www.w3schools.com/html/tryit.asp?filename=tryhtml_formatting_intro3 23. Which of the following is NOT a valid value for the type attribute of the <input> element in HTML 5.0? url week tel radio datetime-local All of the above are the valid values for <input> element https://www.w3schools.com/tags/tag_input.asp 24. What is the role of the <dfn> element in HTML 5.0? It is used to define important text. It is used to define computer code text. It is used to define sample computer code. It is used to define a definition term 25. Which of the following is NOT a valid syntax for the <link> element in HTML 5.0? <link rel=”icon” href=”abc.jpg” sizes=”16×16″> <link rev=”stylesheet” href=”abc.css” type=”text/css” target=”_parent”> <link rel=”alternate” type=”application/pdf” hreflang=”fr” href=”manual-fr”> https://www.w3schools.com/tags/tag_link.asp 26. Which of the following are valid HTML 5.0 elements? <canvas> <summary> <aside> <video> 27. Which of the following is NOT a valid syntax for the element in HTML 5.0? <h1 class="cheader"> This is header 1 </h1 > <h1 align=”center”> This is header 1</h1> <h1 onClick=”dothis(‘sc1′)” >This is header </h1> <h1 style=”cursor:auto;”>This is header </h1>
  • 7.
    Saturday, February 15,2020 Page 7 of 24 28. Which of the following statements are correct with regard to <hr> and <br> elements of HTML 5.0? <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. <hr> element is used to insert the horizontal line within your document and <br> element is used to insert a single line break. <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. 29. What will be the return value when using the window.navigator.appName API method in an HTML 5.0 web application? It will return the version of the browser. It will return the complete User-Agent header. It will return the name of the platform. It will return the name of the browser. https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_nav_appname 30. Which of the following languages will you use to paint the graphics designed using the HTML 5.0 <canvas> tag? o VB script o JavaScript o PostScript o None of the above https://www.w3schools.com/html/html5_canvas.asp 31. Which <iframe> attribute is used to define the restrictions to the frame content in HTML 5.0? seamless sandbox srcdoc 32. In HTML 5.0, what is the function of the sandbox attribute when used with <iframe> as shown below? <iframe src=”aaa ” sandbox=?></iframe> It is used to define the restrictions to the frame content. It is used to define the URL of the document that should appear in the iframe. It is used to specify that an iframe should appear as if it is part of the document the iframe is in. https://www.w3schools.com/tags/att_iframe_sandbox.asp 33. Which of the following statements is correct for a blockquote? It makes the text a bit bigger for emphasizing. It defines a section that is quoted from the another source It makes the text slightly bolder.
  • 8.
    Saturday, February 15,2020 Page 8 of 24 34. Which event is fired when the history of the browser window changes? onpopstate onstorage onresize onhashchange https://www.w3schools.com/jsref/obj_popstateevent.asp 35. When does the ondragleave mouse event get fired in HTML 5.0? 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. 36. Which of the following are valid mouse events in HTML 5.0? ondblclick ondragstart ondragenter onscroll ondrop 37. Which of the following <iframe> attributes are NOT supported in HTML 5.0? height marginheight sandbox scrolling 38. In HTML 5.0, which of the following attributes of the <object> element refers to the location of the object’s data? type codebase data usemap https://www.w3schools.com/tags/tag_object.asp 39. Which of the following is an INVALID parameter for the window.navigator.registerContentHandler API method in an HTML 5.0 web application? url mimeType scheme title https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerContentHandler
  • 9.
    Saturday, February 15,2020 Page 9 of 24 40. When is the window onstorage event triggered in the HTML document? It is triggered when the window is resized. It is triggered when a Web Storage area is updated. It is triggered when a document performs an undo function. It is triggered when the window becomes visible. https://www.w3schools.com/tags/ref_attributes.asp 41. 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> The script is fetched and executed immediately, before the user agent continues parsing the page. The script will be executed when the page has finished parsing. The script will be executed asynchronously, as soon as it is available. 42. Which of the following is correct with regard to the oncanplaythrough event fired by media resources in the HTML 5.0 document? The script will run when the media has reached the end. The script will run when the media is played to the end, without stopping for buffering. The script will run when media data is loaded. The script will run when the length of the media is changed. 43. What is the output when you use the HTML 5.0 code snippet shown below? <body onload=”alert(this)”> It will alert saying “[object HTMLBodyElement]” when the document is loaded. It will alert saying “[object Window]” when the document is loaded. It will alert saying “[this]” when the document is loaded. The alert message is not properly defined in the body element and an error will be generated when the document is loaded. 44. Which of the following represents INVALID syntax for defining an attribute value in an HTML 5.0 document? <input name =’be evil’ /> <input name= be evil/> <input name = “be-evil” /> All of the above. 45. What is the purpose of the <q> element in HTML 5.0? It is used to define the start of a term in a definition list. It is used to define attribute values for one or more columns in a table. It is used to define the start of a short quotation It is used to define what to show browsers that do not support the ruby element. 46. How will you cancel the timeouts that are set with the setInterval() API method identified by the handlers in HTML 5.0? window.clearInterval (handle) window.clearTimeout (handle) window.setInterval (code, timeout) window.setTimeout (code, timeout) https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_win_setinterval
  • 10.
    Saturday, February 15,2020 Page 10 of 24 47. Which of the following tags would assist in creating named groups within a select list? opt group optgroup selectgroup 48. 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? accept autofocus autocomplete formtarget 49. Which HTML 5.0 element will you use to group the related options in a drop-down list? optgroup option menu var nav https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_optgroup 50. This question is based upon the figure shown below
  • 11.
    Saturday, February 15,2020 Page 11 of 24 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? User should define an accept attribute to the input element whose type is url. User should define multiple attribute to the input element whose type is url. User should define a list attribute to the input element whose type is url. User should define a placeholder attribute to the input element whose type is url. 51. What does the icon attribute of the HTML 5.0 command tag define? <command icon=”?”>Click Me!</command> It is used to define the URL of an image to display as the command. It is used to define the name of the radiogroup this command belongs to. It is used to define if the command is checked or not. It is used to define if the command is available or not. https://www.w3schools.com/tags/att_command_icon.asp 52. 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? td p ls pre 53. Which event is fired when an element loses its focus in HTML 5.0 document? onfocus onload onblur onselect 54. What is the purpose of the <keygen> element in HTML 5.0? It is used to define a keyboard text in an HTML 5.0 web page. It is used to generate a public-private key pair in an HTML 5.0 web page. It is used to define a definition term in an HTML 5.0 web page. It is used to define a variable in an HTML 5.0 web page. https://www.tutorialrepublic.com/html-reference/html5-keygen-tag.php 55. Which of the following is NOT a valid attribute for the <video> element in HTML 5.0? controls autoplay disabled preload https://www.w3schools.com/tags/tag_video.asp
  • 12.
    Saturday, February 15,2020 Page 12 of 24 56. 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 link element whose href is “B” A link element whose href is “A” None of the above 57. Which of the following is NOT an attribute of the <meta> element in HTML 5.0? charset content http-equiv scheme https://www.w3schools.com/tags/tag_meta.asp 58. Which of the following is NOT a valid value for the <iframe> sandbox attribute in HTML 5.0? url allow-scripts allow-same-origin allow-forms https://www.w3schools.com/tags/att_iframe_sandbox.asp 59. What is the function of onobsolete, an application cache API method in HTML 5.0? It reflows the HTML document using updated cached content. It triggers an event when the cache content has been marked as obsolete. It triggers an event when the cache content has been updated. It updates the cache for the current document in the background. 60. 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? <html> <body> <script> var newText=document.createElement("anew"); var node=document.createTextNode("New Line."); newText.appendChild(node); var element=document.getElementById("Firstdiv"); var newchild=document.getElementById("a2"); element.insertBefore(newText,newchild); </script>
  • 13.
    Saturday, February 15,2020 Page 13 of 24 <div id="Firstdiv"> <p id="a1">First Line.</p> <p id="a2">Second Line.</p> </div> </body> </html> <html> <body> <div id="Firstdiv"> <p id="a1">First Line.</p> <p id="a2">Second Line.</p> </div> <script> var newText=document.createElement("anew"); var node=document.createTextNode("New Line."); newText.appendChild(node); var element=document.getElementById("Firstdiv"); var newchild=document.getElementById("a2"); element.insertBefore(newText,newchild); </script> </body> </html> <html> <body> <div id="Firstdiv"> <p id="a1">First Line.</p> <p id="a2">Second Line.</p> </div> <script> var newText=document.createElement("anew"); var node=document.createTextNode("New Line."); newText.appendChild(node); var element=document.getElementById("Firstdiv"); element.appendChild(newText); </script> </body> </html> https://code.sololearn.com/WGpm0S0q7fa4
  • 14.
    Saturday, February 15,2020 Page 14 of 24 61. A developer wrote image tag: <img src ="states.gif" width ="330" height ="406" alt="States" usemap ="#statemap" /> What code should follow this? <map id ="statemap" name="statemap"> <area shape ="rect" coords ="0,0,82,126" href="/state1.htm" alt="State1" /> </map> <map id ="statemap" name="statemap"></map> <area shape ="rect" coords ="0,0,82,126" href="/state1.htm" alt="State1" /> <map id ="statemap" name="statemap"> <imgarea shape ="rect" coords ="0,0,82,126" href="/state1.htm" alt="State1" /></map> <map id ="statemap" name="statemap"></map> <imgarea shape ="rect" coords ="0,0,82,126" href="/state1.htm" alt="State1" /> 62. What will be the output of the following HTML DOM code? <!DOCTYPE html> <html><body> <p id="begins">First Attempt! </p> <script> var txt=document.getElementById("begins").innerHTML; </script> </body></html> First Attempt! First Attempt! First Attempt! First Attempt! null First Attempt! begins blank, nothing will appear on screen https://code.sololearn.com/WP3NJnY3Q9N1 63. Which of the following is the correct method to change the background color to indigo with help of a button? <!DOCTYPE html> <html> <body> <script> function ChangeBackground() {
  • 15.
    Saturday, February 15,2020 Page 15 of 24 document.backgroundColor="Indigo"; } </script> <input type="button" value="New Color" onclick="ChangeBackground()"/> </body> </html> <!DOCTYPE html> <html> <body> <input type="button" value="New Color" onclick="ChangeBackground()"/> <script> function ChangeBackground() { document.body.style.backgroundColor="Indigo"; } </script> </body> </html> <!DOCTYPE html> <html> <body> <script> function ChangeBackground() { document.new.backgroundColor="Indigo"; } </script> <input type="button" value="New Color" onclick="ChangeBackground()"/> </body> </html> None of the above https://code.sololearn.com/W1KJQcooIT7t 64. Which of the following is the correct syntax to change the text 'WELCOME!' to 'Hello!'? <h1 onclick=='WELCOME!'>Hello! </h1> <h1 onclick. innerHTML=='Hello!'>WELCOME! </h1> <h1 onclick="this.innerHTML='Hello!'">WELCOME! </h1> <h1 onclick="this.innerHTML='WELCOME!', 'Hello!' </h1> https://code.sololearn.com/WTqZuVP1szkS
  • 16.
    Saturday, February 15,2020 Page 16 of 24 65. 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 webmasterOxcompany.com? <a href="mailto:webmasterOxcompany.com">webmaster</a> <a href="/webmasterOxcompany.com">webmaster</a> <a http="mail:webmasterOxcompany.com">webmaster</a> <mail http="send:webmasterOxcompany.com">webmaster</mail> <a href="mailto://webmasterOxcompany.com">webmaster</a> 66. Suppose you want to display certain text , for example, "First Program !"in red color and times new roman font family on the screen. Which of the following is the correct syntax to do so? <!DOCTYPE html> <html><body> <p id="p1">First program!</p> <script> document.getElementByld("p1").style.color="red"; document.getElementByld("p1").style.fontFamily=Times newroman"; </script><body><html> <!DOCTYPE html> <html><body> <p id="p1 ">First program!</p> <script> document.getElementByld("p1").style.color="red" && style.fontFamily="Times new roman"; </script><body><html> <!DOCTYPE html> <html> <body> <p id="p1 ">First program!</p> <script> document.getElementByld("p1")color="red" && fontFamily="Times new roman"; </script><body><html> None of the above 67. The name property of "Element"node shown in figure will return ____________________.
  • 17.
    Saturday, February 15,2020 Page 17 of 24 tag name name of node name of element value of element https://www.w3schools.com/jsref/prop_node_nodename.asp https://www.w3schools.com/js/js_htmldom_navigation.asp 68. Which of the following is/are the correct method/s to access HTML element? getElementById() getElementsByTagName() getElementsByClassName() All of the above 69. Which of the following is an obsolete attribute of the <ol> element in HTML 5.0? type reversed start compact 70. Which of the following is true about HTML DOM? i) It is a standard object model for HTML ii) It is a programming language. iii) It is a standard programming interface for HTML. i & ii i & iii ii & iii All of the above None of the above https://www.w3schools.com/whatis/whatis_htmldom.asp 71. My favorite color is blue red! Which piece of code will you use in your HTML 5.0 document to get the output as shown in the image? <p>My favorite color is <del>blue</del> <ins>red</ins>!</p> <p>My favorite color is <s>blue</s> red</p> <p>My favorite color is <strike>blue</strike> red!</p> <p>My favorite color is <del>blue</del> red!</pxbr> 72. Consider the above code. What will be the impact upon the contents of the element if both the style sheets define the same class? <html> <head> <title>untitled Page</title> <link rel=stylesheet href=style.css />
  • 18.
    Saturday, February 15,2020 Page 18 of 24 <link rel=stylesheet href=stylel1.css /> </head> <body> <span class="heading">Text goes here.......</span> </body> </html> style.css .heading { font-family:verdana; font-style:normal; font-weight:bold; font-size:11pt; color:Red; } stvle1.css .heading { font-family:verdana; font-style:normal; font-weight:bold; font-size:llpt; color:Blue; } The contents of the element will be of red color and will inherit all the effects of style.css. The contents of the element will be of blue color and will inherit all the effects of style 1.css. The contents of the element will be of white color and will inherit all the effects of style.css and style 1 .css. None of the style effects will be applied to the contents of the element. 73. 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? 89 90 Item 1 Item 2 74. What will be the output of following HTML code? <!DOCTYPE html> <html> <body> <p id="p1">First Program!</p> <script> document.getElementById("p1").innerHTML="New text!"; </script>
  • 19.
    Saturday, February 15,2020 Page 19 of 24 </body> </html> First Program! First Program! null First Program! New text! New text! New text! null https://code.sololearn.com/W2Bf10qX93lU 75. 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); </script> </body> </html> First Attempt! First Attempt! First Attempt! First Attempt! null No output https://code.sololearn.com/WlyttI9T73tg 76. Which of the following are valid values for the contenteditable attribute of the <figure> element in HTML 5.0? True False 0 1
  • 20.
    Saturday, February 15,2020 Page 20 of 24 77. The following link is placed on an HTML webpage <a href=”http://msdn.com” target=”_blank” >MSDN</a> What do you infer from it? It will open the site msdn.com in the same window. It will open the site msdn.com in a new window. It will open the site msdn.com in a frame below. It will not be clickable as it is not formed correctly. 78. Which media event will be fired when a media resource element suddenly becomes empty? Onerror Onended Onloadeddata Onemptied https://www.w3schools.com/tags/att_onemptied.asp 79. Which of the following options are the correct semantic elements? <div> <article> <form> <table> 80. In HTML 5.0, which of the following media events is triggered when fetching of media data is interrupted before it having completely loaded (due to any reason)? onstalled onwaiting onsuspend oninvalid https://www.w3schools.com/jsref/event_onsuspend.asp https://www.w3schools.com/jsref/event_onwaiting.asp https://www.w3schools.com/jsref/event_onstalled.asp 81. For adding a new child node before a specified child node, which of the following methods is used? insertBefore() replaceChild() appendChild() https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_node_insertbefore
  • 21.
    Saturday, February 15,2020 Page 21 of 24 82. Which of the following statements is correct if you invoke the window.prompt (message, default) web application API method in HTML 5.0? It will only show the modal text field prompt with the given message to the user. 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. 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. Both b and c. https://www.w3schools.com/jsref/met_win_prompt.asp 83. Which of the following events is NOT supported in HTML 5.0? oninput oninvalid ondrop onreset https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_oninput https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_ev_onreset https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_oninvalid https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_ev_ondrop All are supported in HTML 5 84. You specified a base tag and anchors as follows: 1. <base target=”_blank”> 2. <a href=”http://www.yahoo.com”>Yahoo</a> 3. <a href=”http://www.google.com” target=”_top”>Google</a> Which of the following is true of the above code? Only the Yahoo link will open in a new window. Only the Google link will open in a new window. Both links will open in a new window. Both links will open in the same window. https://code.sololearn.com/WfapcDK73nnL Note: Yahoo open in a new window and Google open in same window 85. In which of the following conditions is a browsing context A allowed to navigate a second browsing context B? When the browsing context A is a nested browsing context and its top-level browsing context is B. When the browsing context B is an auxiliary browsing context and A is allowed to navigate B’s opener browsing context. The origin of the active document of A is the same as the origin of the active document of B. All of the above
  • 22.
    Saturday, February 15,2020 Page 22 of 24 86. This question is based upon the figure shown below Suppose you placed four radio buttons on a web form. Which of the following statements is correct for the code shown above? Male: <input type-,radio,,checked="checked" name-'chk”value="male"> Female <input type-’radio” name="chk" value-’fern ale“> Married <input type-’radio" checked-’checked” name-’chk" value-’married"> Single: <input type= "radio” name-’chk" value="single"> The user can choose only the male and the married options. The user can choose only the female and single options. The user can choose only one option out of the four. The user can choose all the four options at the same time. The user can choose one option from Male/Female and one from Married/Single. https://code.sololearn.com/WWEQQvkTP5o8 87. What is the function of the history traversal task source in HTML 5.0? It is used for features that react to user interaction, for example, keyboard or mouse input. 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. It is used to queue calls to history.back() and similar APIs. All of the above. 88. Which of the following is the correct method to load another web page or reload the same page in HTML 5.0? <head> <meta http-equiv=refresh content=5> </head> <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>
  • 23.
    Saturday, February 15,2020 Page 23 of 24 <head> <meta http-equiv=refresh content=”5;URL=http://yahoo.com > </head> All of the above https://code.sololearn.com/WY3ZnWBQ5DqZ 89. Which of the following elements preserves spaces and line breaks, and displays the text in fixed- width font? <xmp> <pre> <p> <q> <br> https://www.w3schools.com/tags/tag_pre.asp 90. How will you change the value of the cookies and items in the Storage objects of the localStorage attributes in HTML 5.0? By invoking the window.dialogArguments() API method. By invoking the window. navigator.yieldForStorageUpdates() API method. By invoking the window.navigator.appName API method. 91. 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> The target URL will open in the parent document. The target URL will open in a new window. The target URL will open in the same document in which it was clicked. The target URL will open in the full body of the window. https://www.w3schools.com/tags/att_a_target.asp 92. What will be the browsing context if the browsing context name is _top when the HTML 5.0 web page is loading? It will put the new document in the same window and frame as the current document. It will load the linked document in the topmost frame. It is used in the situation where a frameset file is nested inside another frameset file. Both a and c. Note: Green marked – 100% ok, Yellow marked – Confused
  • 24.
    Saturday, February 15,2020 Page 24 of 24 Thanks for studying my document. Syed Ziaul Habib Professional Tech Trainer and Web Programmer The Computer Limited Naya Paltan, Scout Market, Dhaka Bangladesh roobon@gmail.com www.szhabib.com, www.phpmysqlprojects.com 88/1 Distilary Road, Namapara, Gandaria, Dhaka Exam Result: Masum scored 9.0 https://youtu.be/4ziLGqlZRgs Minar scored 8.2: https://youtu.be/roVICloz9rs Hasib scored 9.0: https://youtu.be/PQrHiqStd14 Resources: http://upwork-test.pe.hu/html5-fiverr-test https://www.youtube.com/watch?v=aQ09t0c0AJ0 https://webcoachbd.wordpress.com/2014/03/16/odesk-test-html5-answers/