Retourner au contenu associé (entrée de forum : afficher ou cacher des tableaux avec deux "radio button")
Posté par Vincent ORDY le 10 janvier 2007 à 18:32. En réponse au message afficher ou cacher des tableaux avec deux "radio button". Évalué à 3.
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
# Exemple
Posté par Vincent ORDY . En réponse au message afficher ou cacher des tableaux avec deux "radio button". Évalué à 3.
<!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" lang="fr" xml:lang="fr">
<head>
<title>::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-15" />
<script type="text/javascript">
<!--
function ShowTab (E)
{
document.getElementById("tab1").style.display = (E == 1) ? 'block' : 'none';
document.getElementById("tab2").style.display = (E == 2) ? 'block' : 'none';
}
//-->
</script>
</head>
<body>
<form id="form" action="">
<div id="form_chk">
<input type="radio"
name="TabCheck"
onclick="ShowTab(1)"
checked="checked" />
<input type="radio"
name="TabCheck"
onclick="ShowTab(2)" />
</div>
</form>
<div id="tab1">
Hello world, thois is the first tab
</div>
<div id="tab2" style="display: none;">
2nd tab
</div>
</body>
</html>
Désolé pour l'indentation, je n'arrive pas à la faire passer ici ... et bonne chance !