Sébastien Adam en clair

Solution d'exercice - JavaScript

<<< Retour énoncés

Exercice JavaScript 12 :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Page de test pour JavaScript</title>
</head>
<body>
<h1>Page de test pour JavaScript</h1>
<script language="javascript" type="text/javascript">
<!--
function member(id, name, grade)
  {
  this.id    = id
  this.name  = name
  this.grade = grade
  function thisToString()
    {
    return "ID: "+this.id+", Nom: "+this.name+", Grade: "+this.grade
    }
  this.toString = thisToString
  }

var sAdam = new member(1, "Sébastien Adam", "ICT Consultant")

document.writeln("<p>"+sAdam+"</p>")
//-->
</script>
<noscript>
<p align="justify"><font color="red"><b>L'affichage de cette page nécessite l'activation du JavaScript.</b></font></p>
</noscript>
</body>
</html>

Pour voir le résultat, cliquez -> ici <-.

Ce site est optimisé pour Mozilla FireFox. L'affichage n'est pas garanti pour votre navigateur. Pour plus d'informations, cliquez -> ici <-.


© Sébastien Adam 1996 ~ 2010 - http://www.sebastienadam.be/ - Le contenu de ce site est soumis à licence. Gestionnaire du site