JS.push has this :target option without much explanation. I tried what it gives to server-side but nothing comes. I thought it might change target property on JS side, but I cannot figure out how does it work. What is it for?
JS.push() events go client --> server and you handle them in LiveView.handle_event/3 or LiveComponent.handle_event/3. You use the :target option to pick where the event is sent. You can target specifically a LiveComponent or you can target any DOM node with a query selector.
For instance in a LiveComponent, you might have something like the following: