I used the .js still showing some issue

Continuing the discussion from Can we use a different file name to use javascript in place of javascript.HTML while practicing?:

please help me asap,cause i need to practice

1 Like


Please mention the training you have taken, so that I can guide you with the necessary information.

‘.js’ files cannot be opened directly. It is included in an HTML file. Without the HTML file, it won’t work as it is a Web Programming Language.
It is called using a < script> tag. Let us say the file name is ‘main.js’, then below is the way you call it inside the HTML file.

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

But from what I assume you are still not clear with the basics of Web Development. Make sure to go through the previous modules carefully, each and every step for a clear understanding of every detail.

Please share your query in the same thread instead of creating a new post for the same issue.

I will close this query, you can share your further details in the previous post.


From what I see in the code, it is an HTML script, so you can use the ‘.html’ extension to save and open the webpage.

Taking reference to your previous query in

It looks like you were using a different code that has 16 lines of code, while the code in this post has only 10. Can you please confirm whether they are the same?

1 Like