DHTML MCQs

DHTML MCQs

The following DHTML MCQs have been compiled by our experts through research, in order to test your knowledge of the subject of DHTML. We encourage you to answer these multiple-choice questions to assess your proficiency.
Please continue by scrolling down.

1: What does DHTML Stand For?

A.   Dynamic HTML

B.   Digital HTML

C.   Data-Binding HTML

D.   Document HTML

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

A.   3

B.   0

C.   2

D.   None of these

3: Which of the following is TRUE about code written in <%= %>?

A.   It is used to bind the particular column with the database value when the Autogenerate column of the binding control is false

B.   It is treated as server side code in scripting languages

C.   It is used for accessing any server side variable into the HTML (in .aspx) page

D.   It is used for special HTML tags

4: Which of the following is true about the function : object.addEventListener(click, doThis, capture)?

A.   capture = "false" will cause doThis() to return null when onClick() event is detected at the capture phase

B.   capture = "false" will cause doThis() to be executed when onClick() event is detected at the capture phase

C.   capture = "true" will cause doThis() to be executed when onClick() event is detected at the bubble phase

D.   capture = "true" will cause doThis() to be executed when onClick() event is detected at the capture phase

5: What technology does DHTML use to produce dynamic content?

A.   AJAX

B.   JavaScript

C.   CSS

D.   CSS and JavaScript

6: What does document.getElementById("intro") function returns if "intro" does not exist?

A.   Create an element with id = "intro" and return that element

B.   Returns false

C.   Returns null

D.   Returns 0

7: Which of the following is not a DOM Mouse Event?

A.   onmouseup

B.   ondblclick

C.   oninit

D.   onclick

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

A.   True

B.   False

9: Which of the following code will display the text “Invisible Man”? <div id="name" class="person">The Invisible Man</div>

A.   document.getElementsByClassName('person')[0].style.display = 'none';

B.   All three codes will not display the text “Invisible Man”

C.   document.getElementsByTagName('div')[0].style.display = 'none';

D.   document.getElementById('name').style.display = 'none';

10: Event bubbling is useful because of which of the following reasons?

A.   Allows multiple common actions to be handled centrally

B.   Reduces the number of code changes required to update a document

C.   Reduces the amount of overall code in the Web page

D.   All are valid reasons

11: Which DHTML technology does the following code utilize? document.write(Date());

A.   JavaScript

B.   HTML

C.   CSS

D.   None of these

12: Which of the following is an INVALID event?

A.   onMouseDown

B.   onMouseOver

C.   onRun

D.   onMouseOut

13: Which of the following is TRUE about data binding feature of DHTML?

A.   It automatically and dynamically generate tables in your document

B.   All are true

C.   Lets you easily bind individual elements in your document to data from another source

D.   It helps to bind the fields in a form to fields in a record

14: Which of the following is a DHTML technology?

A.   JavaScript

B.   CSS

C.   HTML

D.   three choices are DHTML technology

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

A.   True

B.   False

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

A.   False

B.   True

17: Which of the following correctly describes Layer attribute "src"?

A.   The height of the layer

B.   The width of the layer

C.   The name of the layer

D.   The external html document contained inside the layer

18: True or False. CSS supports child selector.

A.   False

B.   True

19: Which of the following properties/methods would you use to animate a div section moving across the screen?

A.   All three choices could be used

B.   element.offsetTop

C.   element.clientHeight

D.   window.setTimeout()

20: Which of the following is not a typical use of DHTML?

A.   Simple Animation

B.   Data Entry

C.   Input Validation

D.   Rollover Buttons

21: Which of the following tags can be used for moving text Up to down or left ot right or vise versa?

A.   <horizontal>

B.   <move>

C.   <marquee>

D.   <scroll>

22: Which of the following is not a VALID component of DHTML?

A.   VB

B.   Conventional HTML

C.   DOM

D.   Absolute Positionin

23: Which of the following is TRUE about code written in <% %>?

A.   It is treated as server side code in scripting languages

B.   It is used to bind the particular column with the database value when the Autogenerate column of the binding control is false

C.   It is treated as code comments

D.   It is used for special HTML tags

24: Which of the following is TRUE about appendChild(newNode)?

A.   It is used for moving nodes

B.   It inserts the new node at the beginning of the list of children of the node

C.   It inserts the new node to the end of the list of children of the node

D.   It inserts the new node but not necessarily at the beginning or end of list of children of the node

25: Which of the following is an INVALID nodeType?

A.   1

B.   3

C.   2

D.   4

26: What kind of scripting language is DHTML?

A.   Server

B.   Client

C.   Neither Client nor Server

D.   Both Client and Server

27: Which of the following tags can be used to refer a .css file in a web page?

A.   <link>

B.   <stylesheet>

C.   <css>

D.   <text>

28: Which DHTML technology does the following code utilize? document.getElementById('id').style.color = 'blue';

A.   JavaScript, DOM and CSS

B.   CSS

C.   JavaScript

D.   DOM

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

A.   blue

B.   yellow

C.   red

D.   green

30: Which of the following code will reliably display the current date in most major browsers?

A.   document.getElementById('id').innerHtml = Date();

B.   document.getElementById('id').innerTEXT= Date();

C.   document.getElementById('id').innerText= Date();

D.   document.getElementById('id').innerHTML = Date();

31: Which of the following events do all Forms have by default?

A.   Both submit and reset event

B.   Only submit event

C.   Neither submit nor reset

D.   Only reset event

32: Which of the following is TRUE about function : document.addEventListener("DOMContentLoaded", testFunc, false)?

A.   the function testFunc() will run as soon as user defined DOMContentLoaded() function returns

B.   The function testFunc() will never be invoked

C.   The function testFunc() will run as soon as the DOM for the document has fully initialized

D.   The function testFunc() will always be invoked

33: Which of the following will cancel the default action of onclick event in IE?

A.   Neither by returning "false" from the event handler nor by setting window.event.returnValue to "false

B.   Only by setting window.event.returnValue to "false and NOT by returning "false" from the event handler

C.   Either by returning "false" from the event handler or by setting window.event.returnValue to "false

D.   Only by returning "false" from the event handler and NOT by setting window.event.returnValue to "false

34: Which of the following functions copies and returns a node?

A.   copyChild(node)

B.   cloneChild(node)

C.   copy(node)

D.   deepCopy(node)

35: Which statement about the difference between DHTML and HTML is true?

A.   HTML is markup language while DHTML is not a language

B.   HTML cannot have server side code while DHTML may have server side code

C.   HTML cannot connect to database while DHTML can connect to database

D.   All three statements are true

36: Which of the following is NOT TRUE about DOM

A.   "document" refers to the actual page

B.   "document" tag is under the <HTML> tag

C.   DOM has a hierarchical structure

D.   <HTML> tag is under the "document"

37: Which of the following function is used for retrieving a XML file in IE5+?

A.   load()

B.   GetXML()

C.   LoadXML()

D.   ActiveXObject()

38: What is the child object appended in the appendChild() method?

A.   last child of the referenced node

B.   before the referenced node

C.   after the referenced node

D.   first child of the referenced node

39: Which of the following functions can be used to stop the event from traversing the rest of the document?

A.   stopPropagation()

B.   fireEvent()

C.   stopEvent()

D.   hault()

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

A.   True

B.   False

41: Which of the following is FALSE about DIV?

A.   DIV tag is used as a paragraph break as it creates a logical division of the document in which it is applied

B.   DIV is used to select a block of text so that one can apply styles to it

C.   DIV is used to select inline text

D.   DIV has ALIGN attribute in it

42: What is the difference between font-size and fontSize?

A.   font-size is a DOM property and fontSize is a CSS attribute

B.   font-size is a CSS property and fontSize is a DOM attribute

C.   font-size is a CSS attribute and fontSize is a DOM property

D.   font-size is a DOM attribute and fontSize is a CSS property

43: Which of the following is a valid way to restrict autocomplete of a form?

A.   autocomplete=”false”

B.   complete=”false”

C.   autocomplete=”off”

D.   complete=”off”

44: Which of the following is not a CSS media type?

A.   mobile

B.   all

C.   screen

D.   print

45: Which of the following is FALSE about SPAN?

A.   SPAN has ALIGN attribute in it

B.   SPAN simply applies the same style and alignment as specified

C.   SPAN is used to select inline text and lets users to apply styles to it

D.   SPAN is used to apply styles inline.

46: Which of the following is NOT TRUE about DHTML?

A.   DHTML is NOT a scripting language

B.   DHTML is a collection of features that together, enable your web page to be dynamic

C.   DHTML is a scripting language

D.   DHTML is the combination of several built-in browser features in fourth generation browsers

47: Which of the following is FALSE about DHTML?

A.   DHTML does not allows scripting languages to change variables in a web page's definition language

B.   In DHTML there may not be any interaction between the client and server after the page is loaded

C.   DHTML page is request/reload-based

D.   DHTML allows scripting languages to change variables in a web page's definition language

48: What does the function "document.styleSheets.length" returns?

A.   Total size of all external style sheets

B.   Length of inline style sheet

C.   Size of first external style sheet

D.   Total # of external style sheets

49: Which of the following is FALSE about DOM?

A.   DOM is a language dependent convention

B.   DOM is a language-independent convention

C.   DOM is a cross-platform

D.   Objects in the DOM tree may be addressed and manipulated by using methods on the objects

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

A.   1

B.   depends on the browser

C.   0

D.   2