Difference between innerText, innerHTML, and childNodes[].value?

前端 未结 11 1477
别跟我提以往
别跟我提以往 2020-11-22 06:57

What is the difference between innerHTML, innerText and childNodes[].value in JavaScript?

11条回答
  •  深忆病人
    2020-11-22 07:48

    InnerText property html-encodes the content, turning

    to <p>, etc. If you want to insert HTML tags you need to use InnerHTML.

提交回复
热议问题