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:
If that doesn’t work, there are a few options:
On click, use a nanoflow (or microflow) to set a reference between your clicked item and the context object. You can then use a conditional visibility expression on the container to show one version when the reference is set, and another when it is not.
Use the HTMLSnippet widget to add JS in your container. You can reference the current element in that JS by using: