1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| <html>
<head>
<script language="javascript" >
function Mafiche()
{ var nom=prompt("votre nom ?","inconnu");
var prenom=prompt("votre prenom ?","inconnu");
var anneenais=prompt("votre annee de naissance (AAAA)","2000" );
var djour=new Date();
var j=djour.getDate();
var m=djour.getMonth()+1;
var a=djour.getFullYear();
var msg="Fiche du ";
alert("fiche :"+nom+" "+prenom);
var age=a_anneenais;
var msg=" Fiche du "+j+" / "+m+" / ";
msg=msg+a+" : "+nom" _ "+prenom;
msg=msg+" vous avez "+age+" ans . ";
alert(msg);
}
</script>
<title> revision javascript exo 0 </title>
</head>
<body>
<button onclick="Mafiche()">Fiche1</button>
</body>
</html> |
Partager