To my knowledge, you cannot reference the DOM element that activated the JS action. So, you can target elements based on ID or class, but cannot target them based on where you clicked.
It may be the case that the element you clicked has focus after the click, and therefore you might be able to target it via:
document.activeElement
If that doesn’t work, there are a few options:
this.domNode
Have you checked the App Store for the Javascript module or similiar? With that you can add individiual HTML or JS code to a page.
Can I access css of the native app pages with the help of javascript actions dynamically on toggle of a button?
Say, I want to increase the font size of the app from 12 to 18 on toggling a button to “On” state with the help of a javascript action on native mobile?