What is the difference between innerhtml and append() in javascript?
Answer / Zia Khan Lohani
innerHTML sets the entire content of an element, replacing existing children. append() adds content to the end of an existing element without disturbing other siblings. For example: document.getElementById("myDiv").innerHTML = "newContent"; replaces everything inside myDiv, while document.getElementById("myDiv").append("newContent"); adds newContent at the end.
| Is This Answer Correct ? | 0 Yes | 0 No |
Explain the typeof operator?
What is a module code?
what is the difference between wrappers and primitives es: diff between int i=200 in primitives and integeri = new integer(54)
Which built-in method returns the calling string value converted to upper case?
How to force a page to go to another page using javascript ?
How to create the namespace in javascript?
how to hide alphabets in java as password '*'
How to create an object in javascript?
How do I add javascript to chrome?
What is an ECMAScript?
How about 2+5+"8"?
How to open a window with no toolbar, but with the location object?