JavaScript and HTML

JavaScript and HTML
0

#1

Hey,

I’ve created a simple JavaScript and HTML webpage on Visual Studio, but the effect of the JavaScript’s codes did not appear on the page!

The thing is, I need to know how I can connect the two codes together, so I can see the effect on the page. I have tried to embed JS’s code in HTML code by using but it didn’t work. I also tried to use the src, and link and both didn’t work as well.

Please see pictures attached for both JS’s and HTML’s codes.

Any help please


#2

You need to either embed your JS in a script tag in the html or link it:

https://www.w3schools.com/tags/att_script_src.asp

Remember to do a search on your questions in Google.


#3

When you want to post code, use a code block rather than a screenshot as it is easier for us to read.

When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.


#4

Cheers guys, I appreciate it