Is it possible to select the content/text node of a tag using css selectors?
For example I have some content such <div><p class="x">Hello world</p></div>
. How can I get/select the text node ("hello world") using CSS?
I know that I could get the p
element using .x
class selector and then use innerHTML with javascript but I would like to know if it's possible to get the exactly text node using CSS and just set the node data (which is basically text as the node is a text node). Is it possible?