Linking your HTML and javascript files


#1

here is my full code for index.html

<!DOCTYPE html>
<html>
    <head>
        <title></title>
     <script type=text/javascript"; src="script.js">
     </script>
        
    </head>
    <body>
        <div></div>
    </body>
</html>

the instructions are

Add a <script> tag to index.html. Its type should be "text/javascript" and its src should be "script.js".

i keep getting an error message saying

Oops, try again. Did you set your <script>'s type attribute to 'text/javascript'?

i am not sure what i am doing wrong here


#2

Hi 10dechad,

You need quotes (") around text/javascript (you're missing a quote in front), and there shouldn't be a semi-colon (;) in there. Like this:

<script type="text/javascript" src="script.js"></script>

:slightly_smiling:


#3

i got it, something simple... thanks man