404 that page doesn't exist

To Whom It May Concern,

My name is Prakash and I’m new to JavaScript.

Summarize the problem.

  1. The goal of this program is to determine what a individuals astrological sign is.
  2. I believe my code could be more concise. But I’m fairly new to JavaScript.
  3. The syntax error states that the document.getElementById()is undefined and a 404 page doesn’t exist pops up.

Describe what you’ve tried.

  1. I changed the document.getElementById() to the .querySelector() and .getElementByClassName.

Code -

https://jsfiddle.net/pherami1/qvz7fwoa/79/

Hello @pH1

the following would fix it

  1. change the button type from submit to button
    check the following links to know the difference
    https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/button

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/submit

  1. you misstype this
 <p class="prompt">            it should be id not class since that what you tryo get in your js by get element by id

if you did that you would not see the button why cause the * selector
so to fix it just move this

<input type="submit" id="submitButton">

to be just before the closing tag of the form not inside
<div class="submitContainer">
as you did in your code

hope that help and have a nice day :slight_smile:

2 Likes

Thank you very much, I appreciate.

1 Like

you very welcome :slight_smile: