hey guys, please i am new to coding and i am having a hard time understanding why my javascript code refused to run in the console. i would really appreciate the help. thanks
Firstly, welcome to the forums.
While we are primarily here to help people with their Free Code Camp progress, we are open to people on other paths, too. You might find that if youâre not getting the instruction and material you need in your current studies, the FCC curriculum will really help you get started. You can find the curriculum at https://www.freecodecamp.org/learn.
With your current questions, we donât have enough context to know what you already know or donât know.
It is pretty typical on here for people to share a codepen / repl.it / jsfiddle example of what they have tried so that anyone helping has more of an idea of what help is actually helpful.
Please provide some example of what youâve tried and Iâm sure youâll get more help.
Happy coding
<script>
document.addEventListener('DOMContentloaded', function() {
document.querySelector('form').onsubmit = () => {
const task = document.querySelector('#task').value;
console.log(task);
//stop form from submitting
return false;
}
})
</script>
Iâve edited your post 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.
See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (â).
okay. thanks for the help
We probably need to see your HTML as well. The best thing to do would be to put this all in codepen and give us a link. But we are open to other alternatives
okay. thanks, i will get right on it
here is the link
Itâs DOMContentLoaded
not DOMContentloaded
(the âLâ is uppercase).
Thank you so much!!! i really appreciate the help. thank you
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.