2

I need to get attributes of the event.target in a Lightning Component's controller, like if I click on <a href...> in component, I need to get the value of href in controller. How to get this?

2

1 Answer 1

3

To get an elements attribute value, you can simply use the native Javascript getAttribute method.

element.getAttribute(attributename)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.