
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
5
1
5

















Powered By WPS Visitor Counter