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 i get the value
If you want to get the innerHTML of the <p> tag then give it an id and then use the 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 you want to get text content inside the element then you can use
var elem = document.getElementById("para1");
var elementText = x.innerText || x.textContent
This won't work, your doing a getElementById but you don't have any elements with Id's...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With