About 50 results
Open links in new tab
  1. REACT: Add Event Listener - The freeCodeCamp Forum

    Jun 20, 2018 · Hi @JP-Dub When inside a class method and referring to other methods/properties in the class, you need to use the this keyword. // Your's document.addEventListener('keydown', …

  2. .addEventListener () Won't Work - The freeCodeCamp Forum

    Apr 14, 2020 · There’s no element with id bgImgInput in your HTML so urlInput is null which causes errors down the line and most likely the addEventListener never gets called. I need to go to bed now …

  3. Help with addEventListener - The freeCodeCamp Forum

    Aug 13, 2018 · Hi everyone! I am just learning JS, and I got stuck in simple addEventListener codes. Can anyone help me understand why the “click” isn’t working in the code below? Thank you! Teste …

  4. Creating an eventlistener (addEventListener) - JavaScript - The ...

    Oct 18, 2020 · I’m not really sure what you’re trying to do, but your selector for the checkbox should be this (you forgot the #): var checkbox = document.querySelector("#IDcheckbox");

  5. addEventListener not working - The freeCodeCamp Forum

    Apr 24, 2019 · I double on what @icelandico said. If I understand well and with my humble knowledge, what is happening in your code is that you defined bu (const bu) gave it a value (= …

  6. Adding-Event-Listeners(Reactjs) - The freeCodeCamp Forum

    Sep 10, 2021 · document.addEventListener("keydown", this.handleKeyPress) In this code an event listener is attached to keydown event. Means every time you press a key in keyboard a function will …

  7. addEventListener click not working same as console

    Aug 25, 2023 · Yes. I guess I might have been a tad more clear about that. onlick is a global event handler HTML attribute, click is the event you listen for in addEventListener. <button …

  8. .addEventListener is not a function even with DOMContent loaded ...

    Jan 3, 2018 · I think .addEventListener isn’t being found as a function because it is not finding the class in my html. but I added document.addEventListener (“DOMContentLoaded”, function (event) { }); …

  9. addEventListener ('Keyup') vs HTML attribute 'Onkeyup'

    Nov 7, 2021 · You should directly target the respective DOM element, in this case the input filed (using getElementById() for example and apply the addEventListener() method on it, while providing a …

  10. Event listener not working - The freeCodeCamp Forum

    Jan 12, 2021 · Get help debugging your JavaScript event listener issue in a todo list app on the freeCodeCamp Forum.