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!

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 trial

JavaScript JavaScript Basics (Retired) Introducing JavaScript Write Another Program

Ali Sh
Ali Sh
2,026 Points

How can i do this question?

how to enter script tags in the index.html?

  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
<script scr="script.js")></script>

2 Answers

16,701 Points

You don't need a source attribute if you're writing javascript inside script tags. You also have two opening and closing script tags, that you don't need.

Try this


Any 'code' must be either between a starting <script> and ending </script> tag OR in the file referenced in the src (Note src, not scr - abbreviation of SouRCe) part of the script tags. You can't do both at the same time though.


  my code here


<script src="mycodefile.js"></script>


<script src="mycodefile.js">
  More code here.