0

The HTML5 tutorials I am currently looking at use

<script scr='lib/jquery/dist/jquery.min.js'></script>'

instead of

<script scr='lib/jquery/dist/jquery.min.js' />

Is there a specific reason why the shorter version is not used?

1
  • your question is, shorter version is used in html5 ? or shorter version is not used in html5? Commented Apr 25, 2015 at 8:48

1 Answer 1

1

Yes there is. The empty elements tag is only valid in XHTML. In HTML5 <script /> just means <script> and not <script></script> So you are not closing your script tag in HTML5. That said, there are a number of self closing tags in HTML5. You can use for instance <br /> it will be interpreted as <br> because it is a self closing tag that does not need to be closed. The tailing slash is added to make it look like XML.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.