Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

“.addEventListener is not a function” why does this error occur?

Asked by Ankesh Kumar Apr 16, 2021 1.7K views 3 answers
Share

About this question

Trying to loop over all the expandable steps in this example but when I run the code below I get this error:this.template.querySelectorAll(...).addEventListener is not a function import { LightningElement } from 'lwc'; export default class AddProductWizard extends LightningElement { renderedCallback(){ this.template.querySelectorAll('.slds-setup-assistant').addEventListener('click',this.handleClick); } handleClick(e){ console.log("Clicked " + this.id); } }

What is reason behind getting  error “addeventlistener is not a function”. Any help would be appreciated

Your answer

3 Answers

Benjamin Latest answer

Answered on Dec 18, 2024

The intuitive design of the Block Blast Solver ensures that players of all ages and experience levels can use it to master the game without any complications.

Was this helpful?

Xeniasn

Answered on Nov 24, 2024

For many bitlife games are a stress reliever. Immersing yourself in a virtual world can help you relax after a long day.

Was this helpful?

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.