innerhtml v.s. outerhtml   
element.innerhtml    reference: https://developer.mozilla.org/en-us/docs/web/api/element/innerhtml   functionality    get serialized html code describing its descendants.   set : remove all the children, parse the content string and assign the resulting nodes as the children of the element.    element.outerhtml    reference: https://developer.mozilla.org/en-us/docs/web/api/element/outerhtml   functionality    get serialized html fragment describling the element and its descendants.   set : replace the element with the nodes generated by parsing the content string with parent of the element as the context node for the fragment parsing algorithm.   note    if element has no parent element, set outerhtml will throw domexception.    e.g. [chrome dev console]  document.documentelement.outerhtml='a';   uncaught domexception: failed to set the 'outerhtml' property on 'element': this element's parent is of type '#document', which is not an element node.   considering below code.
         // html:// this is a div.
container = document.getelementbyid(container);d = document.getelementbyid(d);console.log(container.firstchild.nodename); // logs divd.outerhtml = this paragraph replaced the original div.
;console.log(container.firstchild.nodename); // logs p// the #d div is no longer part of the document tree,// the new paragraph replaced it.
while the element will be replaced in the document, the variable whose outerhtml property was set will still hold a reference to the original element!
 innertext and outertext   node.innertext    non-standard: do not use it on production site.   htmlelement.outertext    non-standard: do not use it on production site.                feature chrome firefox (gecko) internet explorer opera safari (webkit)    
             basic support      4      45 (45)      6      9.6 (probably earlier)      3
textcontent v.s innertext   node.textcontent    get: different node types gets different result    null: document, notation (use document.documentelement.textcontent instead).   text inside the node: cdata, comment, text node, processing instruction. (nodevalue)   concatenation of children nodes (excluding comment, processing instruction nodes) text: other types node   set: remove node children and replace it with a text node.   difference from innertext    many... : refer to mdn.   why we still need innertext sometime?    browser compatibility!    ie has better support for innertext than for textcontent. only ie9+ supports textcontent, but ie6+ supports innertext.   common usage:
    set
             t[t.innertext ? 'innertext' : 'textcontent'] = v.n
get
             it = currheaderchildnodes[i].innertext || currheaderchildnodes[i].textcontent;
textcontent v.s. innerhtml   it's recommand to use textcontent!    innerhtml parse text as html (except script element) -> poor performance!   innerhtml has security problem!
   
 
   