How to accses text inside <p> in html | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to accses text inside <p> in html

<p>text here<span><\span><\p> innerHtml gets the span as well i just only want text here and edit it

3rd Jul 2018, 12:11 PM
Eren
Eren - avatar
1 Answer
+ 2
Use .textContent
3rd Jul 2018, 1:14 PM
Toni Isotalo
Toni Isotalo - avatar