Render modal from theme client-side plugin API

thank you for the tutorial to build a customized modal.
However I’d like to know how to bind an event (like onclick) in the template?