Elance DHTML Test Answers 2015



What does DHTML Stand For?
Document HTML
Data-Binding HTML
Dynamic HTML
Digital HTML


Which of the following events do all Forms have by default?
Only reset event
Both submit and reset event
Only submit event
Neither submit nor reset


Which of the following is FALSE about DOM?
Objects in the DOM tree may be addressed and manipulated by using methods on the objects
DOM is a language dependent convention
DOM is a cross-platform
DOM is a language-independent convention


Which of the following is NOT TRUE about DOM
"document" refers to the actual page
"document" tag is under the <HTML> tag
DOM has a hierarchical structure
<HTML> tag is under the "document"


What is the color of “Rainbow” in the following code? <style> div {color:blue;} </style> <div id="Rainbow" color="green" style="color:red;">Hello World</div> <script> document.getElementById('Rainbow').style.color = 'yellow'; </script>
green
red
blue
yellow


Which of the following tags can be used to refer a .css file in a web page?
<text>
<css>
<link>
<stylesheet>


Which of the following is not a DOM Mouse Event?
ondblclick
onmouseup
oninit
onclick


Event bubbling is useful because of which of the following reasons?
Allows multiple common actions to be handled centrally
Reduces the number of code changes required to update a document
All are valid reasons
Reduces the amount of overall code in the Web page


Which of the following code will display the text “Invisible Man”? <div id="name" class="person">The Invisible Man</div>
document.getElementById('name').style.display = 'none';
document.getElementsByTagName('div')[0].style.display = 'none';
All three codes will not display the text “Invisible Man”
document.getElementsByClassName('person')[0].style.display = 'none';


Which of the following is TRUE about data binding feature of DHTML?
It helps to bind the fields in a form to fields in a record
All are true
It automatically and dynamically generate tables in your document
Lets you easily bind individual elements in your document to data from another source


True or False? DHTML is a single technology.
False
True


Which DHTML technology does the following code utilize? document.write(Date());
HTML
None of these
JavaScript
CSS


Which of the following is an INVALID event?
onRun
onMouseDown
onMouseOut
onMouseOver


True or False. DHTML can be used in conjunction with AJAX.
False
True


Which of the following correctly describes Layer attribute "src"?
The external html document contained inside the layer
The name of the layer
The height of the layer
The width of the layer


Which of the following is a DHTML technology?
three choices are DHTML technology
HTML
CSS
JavaScript


Which of the following tags can be used for moving text Up to down or left ot right or vise versa?
<move>
<scroll>
<marquee>
<horizontal>


Which of the following is not a typical use of DHTML?
Simple Animation
Input Validation
Rollover Buttons
Data Entry


True or False. CSS supports child selector.
False
True


True or False. DHTML can be used in conjunction with HTML5.
False
True


Which of the following properties/methods would you use to animate a div section moving across the screen?
element.offsetTop
element.clientHeight
window.setTimeout()
All three choices could be used


Which of the following is TRUE about code written in <% %>?
It is used to bind the particular column with the database value when the Autogenerate column of the binding control is false
It is used for special HTML tags
It is treated as code comments
It is treated as server side code in scripting languages


Which of the following is not a VALID component of DHTML?
VB
DOM
Absolute Positionin
Conventional HTML


What kind of scripting language is DHTML?
Client
Server
Neither Client nor Server
Both Client and Server


Which of the following is TRUE about appendChild(newNode)?
It is used for moving nodes
It inserts the new node to the end of the list of children of the node
It inserts the new node at the beginning of the list of children of the node
It inserts the new node but not necessarily at the beginning or end of list of children of the node


Which of the following is an INVALID nodeType?
2
4
3
1


What does document.getElementById("intro") function returns if "intro" does not exist?
Returns false
Returns null
Create an element with id = "intro" and return that element
Returns 0


Which DHTML technology does the following code utilize? document.getElementById('id').style.color = 'blue';
DOM
JavaScript
CSS
JavaScript, DOM and CSS


What technology does DHTML use to produce dynamic content?
CSS
AJAX
JavaScript
CSS and JavaScript


Which of the following code will reliably display the current date in most major browsers?
document.getElementById('id').innerTEXT= Date();
document.getElementById('id').innerText= Date();
document.getElementById('id').innerHTML = Date();
document.getElementById('id').innerHtml = Date();


Which of the following will cancel the default action of onclick event in IE?
Either by returning "false" from the event handler or by setting window.event.returnValue to "false
Neither by returning "false" from the event handler nor by setting window.event.returnValue to "false
Only by setting window.event.returnValue to "false and NOT by returning "false" from the event handler
Only by returning "false" from the event handler and NOT by setting window.event.returnValue to "false


What value is displayed in the following code? <div id="id">0</div> <script> document.getElementById('id').innerHTML = 1 document.getElementsByTagName('div').innerHTML = 2 document.getElementsByTagName('div')[0].innerHTML = 3 </script>
0
3
None of these
2


Which of the following functions copies and returns a node?
copy(node)
cloneChild(node)
copyChild(node)
deepCopy(node)


Which of the following is TRUE about function : document.addEventListener("DOMContentLoaded", testFunc, false)?
The function testFunc() will never be invoked
the function testFunc() will run as soon as user defined DOMContentLoaded() function returns
The function testFunc() will always be invoked
The function testFunc() will run as soon as the DOM for the document has fully initialized


Which statement about the difference between DHTML and HTML is true?
HTML is markup language while DHTML is not a language
HTML cannot connect to database while DHTML can connect to database
HTML cannot have server side code while DHTML may have server side code
All three statements are true


Which of the following is true about the function : object.addEventListener(click, doThis, capture)?
capture = "false" will cause doThis() to return null when onClick() event is detected at the capture phase
capture = "true" will cause doThis() to be executed when onClick() event is detected at the capture phase
capture = "true" will cause doThis() to be executed when onClick() event is detected at the bubble phase
capture = "false" will cause doThis() to be executed when onClick() event is detected at the capture phase


Which of the following function is used for retrieving a XML file in IE5+?
load()
GetXML()
ActiveXObject()
LoadXML()


True or False? JQuery is a DHTML technology.
False
True


Which of the following is a valid way to restrict autocomplete of a form?
complete=”off”
complete=”false”
autocomplete=”off”
autocomplete=”false”


Which of the following functions can be used to stop the event from traversing the rest of the document?
fireEvent()
hault()
stopPropagation()
stopEvent()


What is the child object appended in the appendChild() method?
last child of the referenced node
after the referenced node
first child of the referenced node
before the referenced node


Which of the following is not a CSS media type?
print
screen
mobile
all


Which of the following is NOT TRUE about DHTML?
DHTML is a collection of features that together, enable your web page to be dynamic
DHTML is the combination of several built-in browser features in fourth generation browsers
DHTML is NOT a scripting language
DHTML is a scripting language


Which of the following is FALSE about DIV?
DIV is used to select a block of text so that one can apply styles to it
DIV is used to select inline text
DIV has ALIGN attribute in it
DIV tag is used as a paragraph break as it creates a logical division of the document in which it is applied


Which of the following code will flicker the text?
<div id='flicker'>Flicker</div> <script> function toggle() { setTimout(function() { var elm = document.getElementById('flicker'); if (elm.display == 'none') elm.display = 'block'; else elm.display = 'none'; },500); } toggle(); </script>
<div id='flicker'>Flicker</div> <script> function toggle() { setInterval(function() { var elm = document.getElementById('flicker'); if (elm.style.display == 'none') elm.style.display = 'block'; else elm.style.display = 'none'; },500); } toggle(); </script>
<div id='flicker'>Flicker</div> <script> function toggle() { setInterval(function() { var elm = document.getElementById('flicker'); if (elm.display == 'none') elm.display = 'block'; else elm.display = 'none'; },500); } toggle(); </script>
<div id='flicker'>Flicker</div> <script> function toggle() { setTimout(function() { var elm = document.getElementById('flicker'); if (elm.style.display == 'none') elm.style.display = 'block'; else elm.style.display = 'none'; },500); } toggle(); </script>


What is the difference between font-size and fontSize?
font-size is a CSS attribute and fontSize is a DOM property
font-size is a CSS property and fontSize is a DOM attribute
font-size is a DOM attribute and fontSize is a CSS property
font-size is a DOM property and fontSize is a CSS attribute


Which of the following is FALSE about SPAN?
SPAN has ALIGN attribute in it
SPAN is used to apply styles inline.
SPAN is used to select inline text and lets users to apply styles to it
SPAN simply applies the same style and alignment as specified


Which of the following is TRUE about code written in <%= %>?
It is used for accessing any server side variable into the HTML (in .aspx) page
It is used for special HTML tags
It is treated as server side code in scripting languages
It is used to bind the particular column with the database value when the Autogenerate column of the binding control is false


Which of the following is FALSE about addEventListener?
The second argument accepts the function to occur on the event
The first argument accepts what type of event to detect
The first argument accepts the function to occur on the event
It adds an event listener to the node it is "run from"


Which of the following is an INVALID method for accessing HTML attributes using the DOM?
setAttribute()
addAttribute()
getAttribute()
removeAttribute()


Which of the following is FALSE about DHTML?
In DHTML there may not be any interaction between the client and server after the page is loaded
DHTML does not allows scripting languages to change variables in a web page's definition language
DHTML allows scripting languages to change variables in a web page's definition language
DHTML page is request/reload-based


What does the function "document.styleSheets.length" returns?
Total # of external style sheets
Total size of all external style sheets
Length of inline style sheet
Size of first external style sheet


Which javascipt elements allow control in DHTML?
XML element
XHTML element
HTML element
CSS element


What value is displayed in the following code? <div id="id">0</div> <script> document.getElementById('id').innerText = 1 document.getElementsByTagName('div').innerText = 2 document.getElementsByTagName('div')[0].innerText = 3
2
depends on the browser
1
0


What does the Node.nodeType property returns?
a Boolean representing node or element
a string representing the name of the node
an integer representing the type of the node
an object representing the type of the node


Which of the following is TRUE about cancelling event bubbling and event default action?
Both default action and event bubbling cannot be cancelled
Canceling an event's bubbling doesn't cancel its default action
Canceling an event's default action also cancel event bubbling
Canceling an event's bubbling also cancel its default action


What statement about the marquee tag is false?
supports up/down scrolling
is a non-stand HTML element
works only on text elements
supports continuous scrolling


Which of the following is NOT a way to apply css to a web page?
inline
linked
None of these are ways to apply css to a web page.
embedded


True or False? DHTML is a predecessor of HTML5.
True
False


Which of the follow link will trigger an alert message that displays ‘myID’?
<a id="myID" href="#" onclick="javascript::myFunc(this)" />click</a>
<a id="myID" href="#" onclick="myFunc(this)" />click</a>
<a id="myID" href="javascript:myFunc(this)" />click</a>
<a id="myID" href="myFunc(this)" />click</a>


What is the difference between DOM Node and Element?
Element is a property of Node
Node is a property of Element
Node is the parent type of Element
Element is the parent type of Node


Which of the following function is used for restricting events to propogate to parent in IE?
window.event.cancelEvent
window.event.stopEvent
window.event.cancel
window.event.cancelBubble


What is the correct way to access a parent node?
element.parentNode()
element.parentNode
element.parent()
element.up()


What is the event name which gets triggered when the submit button is pressed on the form?
onClick
onMousePressed
onEvent
onSubmit


What does element.childNodes return?
a collection of child nodes
a nodeList of child nodes
an array of child nodes
a pointer to the first child node


What is the color of “Rainbow” in the following code? <style> div {color:blue;} </style> <script> document.getElementById('id').style.color = 'yellow'; </script> <div id="id" color="green" style="color:red;">Rainbow</div>
blue
yellow
green
red


True or False. The appendChild() method can be used to move an element from one element to another.
False
True


Which of the following has the higest priority in CSS?
!important
linked
inline
user defined


What is the color of “Rainbow” in the following code? <style> div {color:blue !important;} </style> <div id="id" color="green" style="color:red !important;">Rainbow</div> <script> document.getElementById('id').style.color = 'yellow !important'; </script>
blue
green
yellow
red


Which of the following attributes is not involved in layer?
width
align
id
tag


What does document.body.nodeType returns?
0
undefined
2
1


Which of the following is not a DOM Event Property?
bubbles
type
name
target


Which of the following is TRUE about replaceChild(Node1, Node2)?
Replace Node2 with Node1
Replace first child in Node 2 with first child in Node1
Remove Node1 and Node2
Replace Node1 with Node2


Which of the following is not a DHTML technology?
All three choices are DHTML technology
AJAX
DOM
HTML


Which of the following is TRUE about iFrame?
iframe is used to embed or insert content on a page of padding
iframe is used for creating an inline or floating frame
All are invalid
An inline frame places another HTML document in a frame.


Which of the following tags checks the nested body content of a tag and determine whether the specified value is an appropriate substring of the requested variable?
<match>
<eval>
<evaluate>
<logic>