My webpage dosent show js script!

i have made 2 separate code as as follows 1)code for HTML save with my-webpage.html
2)js code for javascript save with my-javascript.js.htc
save them both in same folder . but still i am not getting the rrodesire output.
opened my html code in web browser (GOOGLE CHROME)and then right clicked it and selected inspect and then console. but it showing me this message "fail to load resource: net::ERR_FILE_NOT_FOUND!

i am getting a similar message when i try to manipulate HTML content using JS:-
please have a look
IMG_0389|666x500

You need to create a function from the javascript file.The code is:
function myFunction(myName) {
var elem = document.getElementById(“hello”);
elem.innerHTML = elem.innerHTML + myName;
}
And make the extension as .js

1 Like

Hi @pathak.shreyas.s

Read the first answer on this question https://stackoverflow.com/questions/436411/where-should-i-put-script-tags-in-html-markup

You have created JavaScript file with name my-javascriptt. It does not have any .js extension . Your file name should be my-javascript.js

Do let me know in case you need any other information.

1 Like