Answers for "javascript inject html"

0

javascript inject html

var html = '<a href="#" id="playButton">Play</a>';
document.querySelector(".elmentToInjectIn").innerHTML = html;
Posted by: Guest on October-06-2021
-2

how to inject javascript into html

<!DOCTYPE html>
<html lang="en-US">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Today's Date</title>
    <script>
        let d = new Date();
        alert("Today's date is " + d);
    </script>
</head>

<body>

</body>



</html>
Posted by: Guest on March-26-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language