closing tag in HTML

I'm trying jquery now. When I included the jquery.js as follows
<script type="text/javascript" src="jquery.js" />
the code doesn't worked properly. Actually it is just a simple hello world program. I just called a jQuery specific function. But that was not working if I include the file as above. But when I changed the closing like this
<script type="text/javascript" src="jquery.js"></script>
the code worked well. What is the difference?


Answer:

<script /> is valid XML, but invalid HTML.
If you serve your pages as text/xml the browser will correctly load them.


http://stackoverflow.com/questions/9528913/closing-tag-in-html?noredirect=1&lq=1