The code in HTML is:
<span id="testid">aaaa</span>
The obtained js code:
Method 1: .innerText
var x1 = document.getElementById("testid").innerText; alert("x1="+x1);Method 2: .innerHTML
var x2 = document.getElementById("testid").innerHTML; alert("x2="+x2);The above is the full content of the js method (super simple) to obtain the value of the html span tag that the editor brings to you. I hope everyone supports Wulin.com more~