I just curious why my JavaScript can't run (tested in Firefox and IE) if I write the <script>
tag like this:
<script type="text/javascript" src="script.js"/>
It will work if I change that line to:
<script type="text/javascript" src="script.js"></script>
So my question is: why I can't close the script
tag in the start tag since I don't have any content inside it.
My JavaScript code is simple, just:
alert("test");
Notes: I check firefox error console and no error.