Menu mobile
Home
Programming
Python Tutorial
Java Tutorial
C Tutorial
C++ Tutorial
Web Technology
HTML
CSS
Java Script
PHP
React JS
Node JS
Assignment
MS Office
HTML
CSS
Bootstrap
Java Script
JQuery
AngularJs
Project
Blog
QUIZ ON : javascript - JS DOM MANIPULATION
JS DOM MANIPULATION
00:00:00
English
Hindi
Question No# :
01
out of 21
Which of the following is used to change the content of an HTML element?
HTML तत्व की सामग्री को बदलने के लिए निम्नलिखित में से किसका उपयोग किया जाता है?
A.
element.innerHTML
element.innerHTML
B.
element.value
element.value
C.
element.content
element.content
D.
element.innerText
element.innerText
Question No# :
02
out of 21
Which method is used to find an HTML element by its ID?
किसी HTML तत्व को उसकी आईडी द्वारा खोजने के लिए किस विधि का उपयोग किया जाता है?
A.
getElementByTagName()
getElementByTagName()
B.
getElementById()
getElementById()
C.
getElementByClass()
getElementByClass()
D.
querySelector()
querySelector()
Question No# :
03
out of 21
How do you add a new HTML element to the DOM in JavaScript?
आप जावास्क्रिप्ट में DOM में एक नया HTML तत्व कैसे जोड़ते हैं?
A.
document.createElement()
document.createElement()
B.
document.appendElement()
document.appendElement()
C.
document.insertElement()
document.insertElement()
D.
document.newElement()
document.newElement()
Question No# :
04
out of 21
Which method would you use to add an event listener to an element?
किसी ईवेंट श्रोता को किसी तत्व में जोड़ने के लिए आप किस विधि का उपयोग करेंगे?
A.
element.addEvent()
element.addEvent()
B.
element.addEventListener()
element.addEventListener()
C.
element.attachEvent()
element.attachEvent()
D.
element.onEvent()
element.onEvent()
Question No# :
05
out of 21
How can you access all elements with a specific class name?
आप किसी विशिष्ट वर्ग नाम वाले सभी तत्वों तक कैसे पहुंच सकते हैं?
A.
document.getElementByClassName()
document.getElementByClassName()
B.
document.getElementsByClassName()
document.getElementsByClassName()
C.
document.querySelectorAll(".class")
document.querySelectorAll(".class")
D.
Both b and c
Both b and c
Question No# :
06
out of 21
Which of the following methods is used to insert a new element before an existing element in the DOM?
DOM में मौजूदा तत्व से पहले एक नया तत्व डालने के लिए निम्नलिखित में से किस विधि का उपयोग किया जाता है?
A.
insertBefore()
insertBefore()
B.
insertPrevious()
insertPrevious()
C.
appendBefore()
appendBefore()
D.
addBefore()
addBefore()
Question No# :
07
out of 21
How do you append a new child element to an existing element in the DOM?
आप DOM में किसी मौजूदा तत्व में नया चाइल्ड तत्व कैसे जोड़ते हैं?
A.
element.appendChild()
element.appendChild()
B.
element.insertChild()
element.insertChild()
C.
element.addChild()
element.addChild()
D.
element.attachChild()
element.attachChild()
Question No# :
08
out of 21
Which method is used to replace an existing element in the DOM with a new one?
DOM में मौजूदा तत्व को नए तत्व से बदलने के लिए किस विधि का उपयोग किया जाता है?
A.
replaceNode()
replaceNode()
B.
replaceElement()
replaceElement()
C.
replaceChild()
replaceChild()
D.
replaceWith()
replaceWith()
Question No# :
09
out of 21
Which method is used to toggle a class on an element?
किसी तत्व पर कक्षा को टॉगल करने के लिए किस विधि का उपयोग किया जाता है?
A.
classList.add()
classList.add()
B.
classList.remove()
classList.remove()
C.
classList.toggle()
classList.toggle()
D.
classList.replace()
classList.replace()
Question No# :
10
out of 21
How can you access an element by its tag name in JavaScript?
आप जावास्क्रिप्ट में किसी तत्व को उसके टैग नाम से कैसे एक्सेस कर सकते हैं?
A.
document.getElementByTagName()
document.getElementByTagName()
B.
document.getElementsByTagName()
document.getElementsByTagName()
C.
document.querySelectorAll()
document.querySelectorAll()
D.
document.tagName()
document.tagName()
Question No# :
11
out of 21
Which property is used to set or get the HTML content inside an element?
किसी तत्व के अंदर HTML सामग्री को सेट करने या प्राप्त करने के लिए किस प्रॉपर्टी का उपयोग किया जाता है?
A.
innerHTML
innerHTML
B.
outerHTML
outerHTML
C.
textContent
textContent
D.
value
value
Question No# :
12
out of 21
Which of the following methods is used to remove a child element from the DOM?
DOM से चाइल्ड तत्व को हटाने के लिए निम्नलिखित में से किस विधि का उपयोग किया जाता है?
A.
removeElement()
removeElement()
B.
removeNode()
removeNode()
C.
removeChild()
removeChild()
D.
deleteNode()
deleteNode()
Question No# :
13
out of 21
How do you insert an element before another specified element in the DOM?
आप DOM में किसी अन्य निर्दिष्ट तत्व से पहले एक तत्व कैसे सम्मिलित करते हैं?
A.
insertBefore()
insertBefore()
B.
insertAfter()
insertAfter()
C.
appendChild()
appendChild()
D.
prependChild()
prependChild()
Question No# :
14
out of 21
Which property is used to access the parent element of a specified node in the DOM?
DOM में निर्दिष्ट नोड के मूल तत्व तक पहुँचने के लिए किस संपत्ति का उपयोग किया जाता है?
A.
parentElement
parentElement
B.
parentNode
parentNode
C.
parentHTML
parentHTML
D.
parent
parent
Question No# :
15
out of 21
How can you retrieve all the child elements of a specific DOM node?
आप किसी विशिष्ट DOM नोड के सभी चाइल्ड तत्वों को कैसे पुनः प्राप्त कर सकते हैं?
A.
element.getChildren()
element.getChildren()
B.
element.childNodes
element.childNodes
C.
element.getElementsByTagName()
element.getElementsByTagName()
D.
element.getChildNodes()
element.getChildNodes()
Question No# :
16
out of 21
Which of the following methods can be used to remove an attribute from an HTML element?
HTML तत्व से किसी विशेषता को हटाने के लिए निम्नलिखित में से किस विधि का उपयोग किया जा सकता है?
A.
removeAttr()
removeAttr()
B.
deleteAttribute()
deleteAttribute()
C.
removeAttribute()
removeAttribute()
D.
deleteAttr()
deleteAttr()
Question No# :
17
out of 21
<p>What will the following JavaScript code do?</p><pre><span style="font-size: 14px;">var element = document.getElementById("myDiv");<br></span><span style="font-size: 14px;">element.remove();</span></pre>
<p>निम्नलिखित जावास्क्रिप्ट कोड क्या करेगा?</p><pre style="font-size: 12.6px; letter-spacing: 0.14px;"><span style="font-size: 14px;">var element = document.getElementById("myDiv");<br></span><span style="font-size: 14px;">element.remove();</span></pre>
A.
Remove the element with the ID "myDiv" from the DOM
Remove the element with the ID "myDiv" from the DOM
B.
Remove all child elements inside the element with the ID "myDiv"
Remove all child elements inside the element with the ID "myDiv"
C.
Hide the element with the ID "myDiv"
Hide the element with the ID "myDiv"
D.
Move the element with the ID "myDiv" to a different location
Move the element with the ID "myDiv" to a different location
Question No# :
18
out of 21
What is the correct way to change the background color of an element using DOM manipulation?
DOM हेरफेर का उपयोग करके किसी तत्व की पृष्ठभूमि का रंग बदलने का सही तरीका क्या है?
A.
element.background = "red";
element.background = "red";
B.
element.style.backgroundColor = "red";
element.style.backgroundColor = "red";
C.
element.style.background = "red";
element.style.background = "red";
D.
element.css.backgroundColor = "red";
element.css.backgroundColor = "red";
Question No# :
19
out of 21
Which of the following properties is used to check whether an element has child nodes?
निम्नलिखित में से किस गुण का उपयोग यह जांचने के लिए किया जाता है कि किसी तत्व में चाइल्ड नोड हैं या नहीं?
A.
hasChildNodes()
hasChildNodes()
B.
childNodes
childNodes
C.
children
children
D.
hasChildren()
hasChildren()
Question No# :
20
out of 21
Which of the following properties is used to change the text inside an HTML element?
HTML तत्व के अंदर टेक्स्ट को बदलने के लिए निम्नलिखित में से किस गुण का उपयोग किया जाता है?
A.
innerHTML
innerHTML
B.
innerText
innerText
C.
textContent
textContent
D.
All of the above
All of the above
Question No# :
21
out of 21
How can you retrieve the value of an input field in a form using JavaScript?
आप जावास्क्रिप्ट का उपयोग करके किसी फॉर्म में इनपुट फ़ील्ड का मान कैसे प्राप्त कर सकते हैं?
A.
element.getValue()
element.getValue()
B.
element.innerHTML
element.innerHTML
C.
element.value
element.value
D.
element.innerText
element.innerText
Latest Current Affairs 2025
Online Exam Quiz for One day Exam
Online Typing Test
CCC Online Test 2025
Python Programming Tutorials
Best Computer Training Institute in Prayagraj (Allahabad)
Best Java Training Institute in Prayagraj (Allahabad)
Best Python Training Institute in Prayagraj (Allahabad)
O Level Online Test in Hindi
Bank SSC Railway TET UPTET Question Bank
career counselling in allahabad
Sarkari Naukari Notification
Best Website and Software Company in Allahabad
Sarkari Exam Quiz