How to get id from div using onclick in lightning component - Domreysa

Post Top Ad

Post Top Ad

Thursday, December 20, 2018

How to get id from div using onclick in lightning component

Component

<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);
}

1 comment:

  1. Harrah's Cherokee Casino & Hotel - MapYRO
    Find your way around the casino, find where everything is located wooricasinos.info with the most หาเงินออนไลน์ up-to-date information about Harrah's Cherokee casinosites.one Casino https://tricktactoe.com/ & 메이피로출장마사지 Hotel in Cherokee, NC.

    ReplyDelete

Post Top Ad

Responsive Ads Here