I want to take the text of first row from
body in wordpress and I have some problems.
<body id='asd'> <h2>Text1</h2> <p>Text2</p> <b>Text3</b> </body>
This code is working locally. It will output in console, exactly what I need:
Text1, but, in wordpress doesn’t work.
If I try the same code on wordpress, no output is show.
If i try:
On local output is:
[h2, prevObject: r.fn.init(1)]
On wordpress output is:
[selector: "", prevObject: a.fn.init, context: document]
Can someone help?
Read more here: Get text from selector in jquery – wordpress