The easiest way to modify the content of an HTML element is by using the innerHTML property . The innerHTML property gets or sets the HTML or XML markup contained within the element. By using this property, supported in all modern browsers we can assign new HTML or text to any containment element, and the page is instantly updated and reflowed to show the new content.
A DOMString containing the HTML serialization of the element's descendants. Setting the value of innerHTML removes all of the element's descendants and replaces them with nodes constructed by parsing the HTML given in the string htmlString. It is used mostly in the web pages to generate the dynamic html such as registration form, comment form, links etc.