0

There is no inline script, but it still returns an error.

new.html

<!DOCTYPE html>
    <html>
        <head>
            <title>Something</title>
        </head>
    <body>
        <button onclick="increment()">Click Me!</button>
        <p id = "lal">2</p>
        <script src = "popup.js"></script>
    </body>
</html>

popup.js

var num = 1;
function increment(){
    document.getElementById("lal").innerHTML = num * 2;
    num = num * 2;
}
MilkyWay90
  • 1,422
  • 1
  • 7
  • 20

0 Answers0