PHP ZCE mock test, interview preparation, daily lessons under chalk talk

Friday, July 6, 2012

Difference between innerHTML and appendChild

Jquery / Javascript : What is the difference between innerHTML and appendChild?


Answer :

  • appendChild is used to insert new node in DOM.
  • innerHTML is a property of DOM that allows to replace content of an element with different HTML, which automatically gets parsed into DOM nodes.

No comments:

Post a Comment