javascript - Why alert from external JS not appearing -
this question has answer here:
- why don't self-closing script tags work? 10 answers
why no alert appear in following html?
my html
<!doctype html> <html> <head lang="en"> <meta charset="utf-8"> <title></title> <script src="a.js"/> </head> <body> </body> <html>
a.js
alert("hello");
you can't have self closing script tag. change script tag to:
<script src="a.js"></script>
Comments
Post a Comment