javascript - How to get the inner html value -
var str_f = document.getelementbyid("" + j + "").innerhtml; <p> <span style="color: red">advertising cctv/bust</span> <span style="color: red">a</span>tion </p>
how can value
if want innerhtml of <p>
tag give id , use following code
<p id="para1"><span style="color: red"> advertising cctv/bust</span><span style="color: red">a</span>tion </p> document.getelementbyid("para1").innerhtml;
if want text content inside element can use
var elem = document.getelementbyid("para1"); var elementtext = x.innertext || x.textcontent
Comments
Post a Comment