NEW
Font size
Worksheetsjs DOM
Total questions: 20
Worksheet time: 10mins
Which function among the following lets to register a function to be invoked once?
setTimeout()
setTotaltime()
setInterval()
settime()
How is everything treated in HTML DOM?
Node
Attributes
Elements
Arrays
Which object is the top of the hierarchy?
Window Object
Document Object
Form Object
Form Control Elements
What among the following is an appropriate event handler for input text among the below options ?
onclick
onchange
onkeyup
onblur
How are the objects organized in the HTML DOM?
Class-wise
Queue
Hierarchy
Stack
Consider the below code:
Identify the correct code in order to fetch the value entered in username text field?
< body>
< form name="register">
Enter username < input value="John" id="name" name="username">
< /form>
< /body>
document.register.name.value
document.getElementById ("name").value
document.getElementByName ("name").value
None of the above
What will be printed in the console on execution of the below code?
var materials = [
'Hydrogen',
'Helium',
'Lithium',
'Beryllium'
];
console.log(materials.map (material => material.length));
[8, 6, 7, 9]
4
[4]
8, 6, 7, 9
The paragraph P Tag is a part of_______
<body>
<html>
<h1>
both <body> <html>
The node directly above a node is called
sibling
child
parent
ancestral
The node that represent html elements
subclassesnodes
windownodes
htmlnodes
elementnodes
What is the reason for avoiding the attributes property in the HTML DOM?
Found unnecessary
Attributes don’t have attributes
Attributes have attributes
Considered irrelevant
The primary purpose of the array map() function is that it __________
maps the elements of another array into itself
passes each element of the array and returns the necessary mapped elements
passes each element of the array on which it is invoked to the function you specify, and returns an array containing the values returned by that function
pass the elements of the array into another array
In general, event handler is nothing but ____________
function
interface
event
handler
What is the purpose of a return statement in a function ?
Returns the value and continues executing rest of the statements, if any
Returns the value and stops the program
Returns the value and stops executing the function
Stops executing the function and returns the value
What is the purpose of the Attr object in the HTML DOM?
Used to focus on a particular part of the HTML page
HTML Attribute
Used to arrange elements
CSS attribute
The focus and blur events are also part of _________
Element events
Handler events
Window events
Scroll events
Which syntax is used to describe elements in CSS?
Protectors
Selectors
Both Protectors and Selectors
Protectors or Selectors
Remove an item from the end of an array.
let cats = ['Bob', 'Willy', 'Mini'];
cats.pop();
['Bob','willy','Mini'];
['Bob','willy'];
['willy','Mini'];
['Bob','Mini'];
What is mean by "this" keyword in javascript?
It refers current object
It referes previous object
It is variable which contains value
None of the above
In JavaScript, Window.prompt() method return true or false value ?
False
True
