Java script in web page

in my html code even after adding the javascript file its not showing after opening it.I did exactly as it was mentioned in the course but I don’t know what is wrong

@muskansinghal23118
no need to add file .
In your html file , you can add the content of the java script file in the tag script and closing it by /script

example: In the html file inside the body tag you can add this

script
java script content
/script

note: this is when the 1st way is not working(the one by which its done in the video). and wherever i wrote script and /script it should start and end with the angular brackets.

Hope it works now!

@muskansinghal23118

Please make sure that you are importing the JS file correctly with relevant path.
Ideally while developing the project, keep the js file in the same folder where the html file is present and use it directly.
Also, make sure you have not misspelled the filename in the code.

Can you share the HTML code so that we could debug the same and resolve your issue?

You can write in the script tag also for example

It’s just an example only I’m giving to you. I have tired many examples and formed many html pages using javascript and CSS.
Or you can make another file with .js extension and copy the whole path of that file and paste it in

As I have given full path of the file, because sometime html file and js file is not in same folder so, error occurs so you can give full path so that your code may run.
I used tomcat server to run my html codes, you can also use that, it will be helpful to you in future.
I hope you got the answer.

Then, you have to check your js file path??
and consider the js path in your html file.
I hope this will be helpfull.

@muskansinghal23118
From the code that you have shared, the js file having name “my-javascript.js” must be present in the same folder as that of your html page.

If it still doesn’t work, please share the entire html as well as js code. The code that you have shared is incomplete, the first 10 lines are not visible.