Please am having a challenge with how to use event listener, can I get help as to how to go about it?
Thanks
Eventlistener
Can you provide more details, such as what event you’re trying to listen for and why? Your question is a little open ended.
That said:
Please I want use the evenlistener such that the text and color will change when the mouse is hovered on it, I see codes as per the image below
I used the code
after connecting js. to the html on sublime.This is the feedback I get on the console using the chrome browser
Cannot read properties of null ( reading ‘addEventListener’).
Your assistance will be much more appreciated please.
Thank you
Oh I see; your question is JavaScript related and not Sublime Text related.
This is a support forum for Sublime and not for general computing problems, so I would recommend that if you have issues like this you ask in a more HTML/JavaScript specific location.
That said, your error is caused by the call to querySelector
on line 1 returning null
because the HTML page has no tag with a id="one"
in it.