How to get id from div using onclick in lightning component
Component
Controller
<div data-account-id="{! account.Id }" onclick="{! c.selectAccount }">click me</div>
Controller
selectAccount: function (cmp, event, helper) {
var id = event.currentTarget.dataset.accountId;
console.log(id);
}
Comments
Post a Comment