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

Why event target is empty?

Asked by Ankit Chauhan Apr 5, 2021 14 views 1 answer
Share

About this question

 I want to get index variable of products array record in controller on which user clicked. I am trying to get this by event.target.dataset.index. But event.target.dataset.index gives undefined. The code is as below:

Component

{!product.Name}{!product.ProductCode}

Controller

ShowDataOnClick: function(component, event, helper) { var index = event.target.dataset.index; console.log(index); }


Your answer

1 Answer

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.