Which JavaScript method is used to add a new HTML element to the DOM?DOM में एक नया HTML तत्व जोड़ने के लिए किस JavaScript विधि का उपयोग किया जाता है?
DOM में एक नया HTML तत्व जोड़ने के लिए किस JavaScript विधि का उपयोग किया जाता है?
Show answerHide answer
Correct answer: (B) createElement()createElement()
Explanation
document.createElement() creates the new HTML element, which is then inserted into the page with appendChild() or append(). The other options are not standard DOM methods.document.createElement() नया HTML तत्व बनाता है, जिसे फिर appendChild() या append() से पेज में डाला जाता है। अन्य विकल्प मानक DOM मेथड नहीं हैं।