and not in HTML5?", "text": "<p>Why the following line is not working in many browsers (mozilla, IE)?</p>\n\n<pre class="prettyprint"><code><script src="jQuery.js" />\n</code></pre>\n\n<p>Why we must set it like this?</p>\n\n<pre class="prettyprint"><code><script src="jQuery.js"></script>\n</code></pre>\n\n<p>These days I convert my project from XHTML to HTML5 and I face some minor but disturbing incombatibilities.</p>", "answerCount": 1, "upvoteCount": 739, "dateCreated": "2026-06-20 11:05:07", "dateModified": "2026-06-22 23:10:32", "author": { "type": "Person", "name": "Chameleon" }, "acceptedAnswer": { "@type": "Answer", "text": "<p>While a script element can have the content loaded from an external URL via the <code>src</code> attribute, it can also have the code inline (as a child node). This means it is not an <code>EMPTY</code> element so can't require that the end tag be omitted. </p>\n\n<p>In HTML 5 the <code>/</code> at the end of a start tag does not mean "This is a self-closing tag", it is just syntactic sugar for people who have written too much XML or are using XML syntax highlighters.</p>\n\n<p>Even if you were still writing XHTML, you probably couldn't use the <code><script /></code> syntax as it is not HTML compatible.</p>", "upvoteCount": 140, "url": "https://www.exchangetuts.com/why-scriptscript-and-not-script-in-html5-1767793802289537#answer-1782212707197800", "dateCreated": "2026-06-22 11:10:32", "dateModified": "2026-06-22 23:10:32", "author": { "type": "Person", "name": "Quentin" } } } }