Element Content

Element Content As HTML

innerHTML property of an Element returns the content of that element as a string of markup.

When you query outerHTML, the string of HTML or XML markup that is returned includes the opening and closing tags of the element on which you queried it.

insertAdjacentHTML() method, which allows you to insert a string of arbitrary HTML markup “adjacent” to the specified element.

Element Contetn As Plain Text

query the content of an element as plain text, or to insert plain- text into a document. The standard way to do this is with the textContent property of Node

    var para = document.getElementsByTagName("p")[0]; 
    var text = para.textContent; 
    para.textContent = "Hello World!"; 

Element Contetn As Text Nodes