Use of Data Attributes
September 20, 2023
- use to pass data specified in custom attributes on HTML elements and get it in JavaScript to perform some logic.
<lightning-input type="text" value={someValue} data-name={itemName} data-id={index} data-title={itemTitle} onchange={handleChange} />
let rowIndex = event.currentTarget.dataset.id; let orderName = event.currentTarget.dataset.name; let orderTitle = event.currentTarget.dataset.title;
5
2
votes
Article Rating
Subscribe
Login
0 Comments
Oldest
Newest
Most Voted
Inline Feedbacks
View all comments
Latest Post
About Me
Welcome to an Aimer's weblog :)
Hi! Asif Parvez here, I'm from West Bengal's Howrah. I have extensive experience in Apex, Integration (REST API), LWC, ADMIN and working as Senior Salesforce Developer for Dazeworks Technologies(An iLink Digital Company). I am also a content creator and blogger.
I have three certifications(PD-I, PD-II, Salesforce Associate).
Our Visitor
Our Visitor
0
0
0
3
8
2
Users Today : 0
Users Yesterday : 0
Users Last 7 days : 12
Users Last 30 days : 41
Users This Month : 33
Users This Year : 381
Total Users : 382
Views Today :
Views Yesterday :
Views Last 7 days : 45
Views Last 30 days : 79
Views This Month : 70
Views This Year : 715
Total views : 716
Who's Online : 0
Your IP Address : 3.138.67.56
Server Time : 2024-12-23
Powered By WPS Visitor Counter