Bonsoir à tous,
savez vous comment change t on la valeur d'un bouton par exemple qui possède la valeur onclick?
voici un exemple très simple d'una page html avec un html qui change d'état:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns="
http://www.w3.org/1999/xhtml ">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-5" />
<title>Test</title>
</head>
<SCRIPT language="Javascript">
function annuler() {
alert ("ok");
}
function hello() {
document.getElementById('test').value = "annuler";
document.getElementById('test').id = "annuler";
document.getElementById('test').onclick= function(){ alert("ok"); } ;
}
</SCRIPT>
</html>
Lorsque j'appuie sur Test, les attributs 'id' et 'value' sont bien changé, mais l'attribut 'onclick' ne l'ait pas! pouvez vous me dire comment procéder?
Merci d'avance pour votre aide,
berni ;-)
Afficher la suite