You need to sign in to do that
Don't have an account?
Shuhbam Sinha
How to query dataset attribute in JS lwc
Hello Everyone,
I am using lightning input field on record edit form to creat a record and my requirement is to query the data attribute of lightning input field. Is there any way to query the specific data attribute which matches with the field of 'this.template.querySelectorAll('lightning-input-field').forEach((field) => {)};'
Please let me know on the same.Thanks in Advance
I am using lightning input field on record edit form to creat a record and my requirement is to query the data attribute of lightning input field. Is there any way to query the specific data attribute which matches with the field of 'this.template.querySelectorAll('lightning-input-field').forEach((field) => {)};'
Please let me know on the same.Thanks in Advance
You can query the data attribute of a Lightning input field using the dataset property. Here's an example of how you can modify your existing code to retrieve the data attribute value:
If it helps please mark this as Best Answer.
Thank you.