html - Why don't we use <script src='xyz' /> in HTML5? -


the html5 tutorials looking @ use

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

instead of

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

is there specific reason why shorter version not used?

yes there is. empty elements tag valid in xhtml. in html5 <script /> means <script> , not <script></script> not closing script tag in html5. said, there number of self closing tags in html5. can use instance <br /> interpreted <br> because self closing tag not need closed. tailing slash added make xml.


Comments

Popular posts from this blog

python - Installing PyDev in eclipse is failed -

PHP OOP-based login system -

python - Exception while importing pymorphy2 -