I'm developing a plugin that use shortcodes to display some "special" buttons on frontend. These shortcodes generate HTML, CSS and JavaScript for the button so, if the user insert multiple shortcodes in the same page (to have more than one button), the same JavaScript code is repetead for each shortcode (button). How can I allow the user to insert multiple buttons in the same page without replicate JavaScript code more than one time?
For example: if the user insert 3 buttons on the page when one of these buttons is clicked the click event handler function is exectuted 3 times...