Answers for "how to add html from the javascript"

18

adding javascript in html

<script type="text/javascript" src="path-to-javascript-file.js"></script>
Posted by: Guest on March-08-2020
1

how to insert html in javascript

var h = document.getElementById("myH2");
h.insertAdjacentHTML("afterend", "<p>My new paragraph</p>");
Posted by: Guest on July-13-2021

Code answers related to "how to add html from the javascript"

Browse Popular Code Answers by Language