Answers for "script tag placement html"

10

how to add script in html head

<script src="script.js" defer></script>

<!--just add defer attribute so script will execute at last-->
Posted by: Guest on August-21-2020
0

script tag placement html

<!DOCTYPE html>
<html>
<body>

<h2>JavaScript in Body</h2>

<p id="demo"></p>

<script>
document.getElementById("demo").innerHTML = "My First JavaScript";
</script>

</body>
</html>
Posted by: Guest on July-12-2021

Browse Popular Code Answers by Language