Report Bug

Qus

What will the following JavaScript code do?

var element = document.getElementById("myDiv");
element.remove();
Qus

निम्नलिखित जावास्क्रिप्ट कोड क्या करेगा?

var element = document.getElementById("myDiv");
element.remove();


A. Remove the element with the ID "myDiv" from the DOM
B. Remove all child elements inside the element with the ID "myDiv"
C. Hide the element with the ID "myDiv"
D. Move the element with the ID "myDiv" to a different location


Solution
A. Remove the element with the ID "myDiv" from the DOM



Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2026 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 Best Website and Software Company in Allahabad