Why is JavaScript code not working in Dreamweaver

I’m currently working on a school project where I have to create a website and include some sort of javascriptitng. We have to use Dreamweaver to write up our code html and css.

For some reason the code dose not work, im not sure why: i followed a youtube video for the JS code and there is no errors from what i know. Maybe its just because of dreamweaver. I have created a JS file and wrote my code in there and the file is in the root folder of the website. The file is also connected to the page, it my be connected wrong i really dont know what is wrong.

Here is the HTML CODE

Here is the JS code