+ 1

If I give my function a name, suddenly my code won’t run???

This has happened to me with two other JavaScript apps. I don’t understand what is happening, or why.

27th Oct 2019, 12:19 AM
Kimi
2 odpowiedzi
0
html: <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width" /> <title>k</title> <link rel="stylesheet" href="style.css" /> </head> <body> <h1>k</h1> <div id="test"></div> <script src="script.js"></script> </body> </html> javascript: addEventListener('load', function(e) { document.querySelector('#test').innerHTML = 'k'; }); function HelloWorld(){ alert("Hello World!"); };
27th Oct 2019, 9:32 AM
Kimi