mercredi 7 février 2018

Loading javascript function on button event

I would like to call a Javascript function once the button is displayed on screen. What I am looking for is similar to the 'onclick' attribute:

<input type="button" class="button-class" onclick="function(this)">

However, I would like the function to be called as soon as the button is displayed on screen i.e. it should be instantaneous (button creation=function call). I have already tried 'onload' but this does not seem to work. Is there a way to do this please?

Thank you

Aucun commentaire:

Enregistrer un commentaire