I want to add a javascript function to a button that is created by a plugin (therefore I can't add the function on the button creation). How should I add this function with javascript? I thought about getElementByClass("class"), but not sure if it will fail due to the cache plugins and maybe dom not being ready? Should I wait for dom or there's no need and, in case I need, how should I do it?