I try to deduce the value 1 from the <span id="st">1</span> , as soon as I place this code not in the * .php file but in a separate file for * .js scripts, the code does not work. Tell me how to make this code run from another file?
<html> <body> <span id="st">1</span> <script src="/project/unix.js" defer async> </script> </body> </html> <script> var page = document.getElementById('st'); var fff =page.firstChild.nodeValue; alert(fff); </script>
<script src="путь_к_вашему.js/>- Sublihim<script src="/project/unix.js" defer async> </scriptin my project so it is written, the rest of the scripts work perfectly. What I don’t know with this code is that it’s not working ( - Eliotasync:) - Pavel Mayorov