Introduction to the Document Object Model (DOM)

Qus. 1 : How do you add a new HTML element to the DOM in JavaScript?

  1. document.createElement()
  2. document.appendElement()
  3. document.insertElement()
  4. document.newElement()
Qus. 2 : Which of the following methods is used to remove a child element from the DOM?

  1. removeElement()
  2. removeNode()
  3. removeChild()
  4. deleteNode()
Qus. 3 : How can you retrieve the value of an input field in a form using JavaScript?

  1. element.getValue()
  2. element.innerHTML
  3. element.value
  4. element.innerText
Qus. 4 : How do you append a new child element to an existing element in the DOM?

  1. element.appendChild()
  2. element.insertChild()
  3. element.addChild()
  4. element.attachChild()
Qus. 5 : Which property is used to set or get the HTML content inside an element?

  1. innerHTML
  2. outerHTML
  3. textContent
  4. value

Programs

Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad