Learn Basic JavaScript by Building a Role Playing Game - Step 18

I am on step 18, and the instruction says " Step 18

Before you start writing your project code, you should move it to its own file to keep things organized.

Remove your console.log("Hello World"); line. Then give your now empty script element a src attribute set to ./script.js."

I answered and wrote the following code: <script src=“./script.js”

this was the answer: Sorry, your code does not pass. Try again.

Your script element should have a src attribute set to ./script.js.

please help I don’t understand.

Hello!

I tripped over this as well, the task is a bit misleading.

Just put “script.js” without ./ in the source and you’ll pass!

1 Like

@hlomambalula10
Welcome to the fCC community. Thanks for posting for the first time.
The fCC community is here to serve you. In order for the community to help you better please help us by providing more information.
You told us that you are on step 18, that’s a great start. Please share your code here. You can hit the back tick button three times.

Paste your code below the three back ticks. then add three back ticks below your code

wrap your code with backticks
type or paste your code
The back tick key on your keyboard should be below your esc button on the upper left side.
download (4) –Happy Coding.

You can always google a new concept for a deeper explanation:
https://www.w3schools.com/TAGS/att_script_src.asp

Example

Point to an external JavaScript file:
<script src="myscripts.js"></script> 

Make sure you also have a closing script tag.

1 Like

Okay Thank you I got it

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.