Hello. Could you please tell me if you find why my code is invalid? Thanks in advance!
Task: 1. When you click on the #check-btn element without entering a value into the #text-input element, an alert should appear with the text "Please input a value".
Could you share your full code with us please, instead of screenshots?
Have you linked to your script.js file in your HTML doc?
I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
I’ve edited your code for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.
You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.
the html file and the javascript files are not linked together, the browser reads the HTML file, and if you don’t mention the JS file in the HTML file the browser doesn’t know where to get the JavaScript from
you need to add the script element that links to the script.js file
On some platforms (w3schools, codepen etc) these things are handled in the background for you, but otherwise you should be using a proper HTML boilerplate setup. Your HTML doc should have a head and a body and all of the meta, link and script elements which are routinely required.
Here’s a useful explainer, written by one of the staff here at FCC: