Sorry du UP, j'avais que ça a faire
Désolé, sa sert a rien
EDIT : OMG, je suis valide XHTML
worldAndVillage.js a écrit :Code :var ShowedVillage="";
function showVillage(world)
{
sWorld = document.getElementById(world);
if (sWorld.style.display !='')
{
sWorld.style.display='';
if (ShowedVillage != "")
{
ShowedVillage.style.display = 'none';
}
ShowedVillage = sWorld;
}
}
style.css a écrit :Code :.world {
color : #FF9900;
}
.villages {
margin-left : 70px;
}
Ta Page HTML a écrit :Code :<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr_FR" lang="fr_FR">
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />
<title>Javascript :: JeuPHP</title>
<script type='text/javascript' src='worldAndVillage.js'></script>
<link href="style.css" type="text/css" rel="stylesheet" />
</head>
<body>
<h1>Essai de Javascript</h1>
<form method="post" action="">
<p class="world">
<input name="world" value="land" onchange="javascript:showVillage('land');" type="radio" />Terre<br />
<input name="world" value="istland" onchange="javascript:showVillage('island');" type="radio" />Mer<br />
<input name="world" value="sky" onchange="javascript:showVillage('sky');" type="radio" />Ciel
</p>
<div class="villages">
<span id="land" style="display: none;">
<input name="landVillage" value="Alpha" type="radio" />Alpha<br />
<input name="landVillage" value="Bravo" type="radio" />Bravo<br />
</span>
<span id="island" style="display: none;">
<input name="islandVillage" value="Charlie" type="radio" />Charlie<br />
<input name="islandVillage" value="Delta" type="radio" />Delta<br />
</span>
<span id="sky" style="display: none;">
<input name="skyVillage" value="Echo" type="radio" />Echo<br />
<input name="skyVillage" value="Fox" type="radio" />Fox<br />
</span>
</div>
<p><input type="submit" value="Envoyer"/></p>
</form>
</body>
</html>
Désolé, sa sert a rien
EDIT : OMG, je suis valide XHTML