Bootstrap
I have the following button from a bootstrap template.
<p><a class="btn btn-primary btn-lg" href="#" role="button">texto_boton »</a></p>
How can I make onclick launch a script that is in the js folder
Bootstrap
I have the following button from a bootstrap template.
<p><a class="btn btn-primary btn-lg" href="#" role="button">texto_boton »</a></p>
How can I make onclick launch a script that is in the js folder
First of all you have to have the script linked to the html.
A simple example would be:
If you already have it linked, add a:
Example:
In this way you would be executing a javascript function when that link is clicked from an external file.
If you want a file to be loaded every time a link is clicked, you could do it like this:
But from what I read in the comments, it seems to me that what you want is that every time a text file is loaded, a script is executed. For this you may be interested in something else:
did you try with
One of the ways is:
Greetings.