Tried to enhance confetti button plugin to work with native Carrd buttons but failed so far

Adding an element ID to a Carrd button adds it to a ul element, not the button element itself, hence the original code doesn't work directly. Need to find a way to addEventListener to the li item instead of the ul element...

Resource to append a script inside a Javascript function
https://stackoverflow.com/questions/9413737/how-to-append-script-script-in-javascript