Qus : How do you insert an element before another specified element in the DOM?
Qusआप DOM में किसी अन्य निर्दिष्ट तत्व से पहले एक तत्व कैसे सम्मिलित करते हैं?
A. insertBefore() B. insertAfter()
C. appendChild() D. prependChild()
Solution
A. insertBefore()
Explanation
The insertBefore() method inserts a new node before an existing node. It requires a reference to both the new node and the existing node in the DOM.