Binding <span id = "outer"> <span id = "inter"> text </ span> </ span> this structure, the difference between the talk innerHTML, outerHTML, innerText


  innerHTML output current text labels, if there is a child tag in the tag will be output together even text within the tag itself and sub-sub-labels.

  SUMMARY #outer output sub-label itself and the sub-label: <span ID = "Inter"> text </ span>
  #INTER output current label content: text


  innerText output only text in the current label, if there is a child tag in the tag, then only output the text content within the sub-tab.

  #outer output current contents of the label and child label: text
  #INTER output current label content: text

 

  outerHTML output itself and the text inside the tag of the current tag, if there is a sub tag, the sub tag itself and the text inside the tag will be output together.

  #outer output current label and the label itself and the sub-label content: <span id = "outer" > <span id = "inter"> text </ span> </ span>
  Label #inter tag itself and the output sub-content: < span id = "inter"> text </ span>

Guess you like

Origin www.cnblogs.com/wuqilang/p/11204643.html