Bonjour,
je cherche à ajouter du code aux boutons existants :
<button onclick="xxx;" name="..." ...>
deviendrait
<button onclick="add;xxx;" name="..." ...>
fichier .js :
1 2 3 4 5 6 7 8 9 10 11 12 13
| function init() {
var boutons = document.getElementsByTagName('button');
// Ajout devant au cas où il y ait un 'return false;' en fin
for (n = 0; n < boutons.length; n++) boutons[n].onclick = 'add;' + boutons[n].onclick;
return;
}
function add() {
...
}
init(); |
quelqu'un a-t-il une idée, tous mes essais sont vains ...
Merci pour l'aide apportée
Partager