Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMatthew Conrad
28,069 PointsShould you include the type of script being used in the <script> tag?
Hi,
I'm new to JavaScript and was just wondering if it's best practice to include the type attribute of text/javascript in the <script> tag? For example,
<script type="text/javascript" src="script.js"></script>
Or does it even really matter?
1 Answer
Abraham Juliot
47,353 PointsIt's not needed in HTML5
<!-- HTML4 and (x)HTML -->
<script type="text/javascript" src="javascript.js"></script>
<!-- HTML5 -->
<script src="javascript.js"></script>
Moderator Edit: Moved response from Comment Section to Answers and edited Markdown for HTML Syntax Highlighting