activar funcion js con id
// Función externa
function muestraMensaje() {
alert('Gracias por pinchar');
}
// Asignar la función externa al elemento
document.getElementById("pinchable").onclick = muestraMensaje;
// Elemento HTML puede ser: input, button, span, a, p, label, div, etc.
<input id="pinchable" type="button" value="Pinchame y verás" />
Also in JavaScript:
- js string times
- how to get utc time in angular
- using multiple http verbs on express path request
- jquery animation
- generate random number jquery
- javascript indexof with condition
- pull out only text from element javascript
- react conditional classname
- snackbar in react
- javascript detect dark mode
- string repeat javascript
- laravel json eloquent
- how to get the last eleemnt of an array
- break loop after time javascript
- jquery show hide
- How to create HTML forms and attach JavaScript behaviors ALL TYPES
- compare date and time in js
- javascript trigger click on element
- push notification not working on standalone react native
- read and save excel with react
- list listener on a page js
- element.classname javascript
- watchman watch-del-all, and react-native start --reset-cache
- sum range javascript