Calling a Javasript function from an html code. Note: Javascript code is in the same file

Asked

Viewed 574 times

0

I need to call functions in html without a button, calling when a part of the html code is executed. with the button I already did, it looks like this :

<input type="button" value="Nome do botão" onclick="nomeDaFuncao();" />

wanted to call the same event that this button does, but only when a part of the code is executed

  • 1

    What do you mean "calling HTML functions without a button"? you can join in Javascript nomeDaFuncao(); and that runs the right function?

  • 1

    Did you want to run something when a part of HTML is charged? If that’s it, put it on <script>nomeDaFuncao();</script> after the relevant HTML snippet.

  • vlws man, that was it ;) Thank you very much

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.