よくわかりません。JavaScript の例で CSS を使用して 3 つのボタンを非表示にしようとしましたが、何も起こりませんでした。li.two と li.three が非表示にならないのはなぜですか? ボタンをクリックするまで、li.two と li.three が表示されないようにしたいと考えています。(Yahoo は Google をクリックしたときにのみ表示され、Facebook は Yahoo をクリックしたときにのみ表示されます) コードは次のとおりです。
<html>
<head>
<script type="text/javascript">
function show_prompt()
{
var name=prompt("Your Name");
if (name!=null && name!="")
{
alert("Thanks for clicking " + name + "!");
window.open("http://www.google.com/};
}
</script>
<script type="text/javascript">
function show_alert()
{
alert("Thanks for clicking me!");
window.open("http://www.yahoo.com/");
}
</script>
<script type="text/javascript">
function show_alert1()
{
alert("Have fun on Facebook!");
window.open("http://www.facebook.com/");
}
</script>
<script type="css/text">
li.two, li.three {display:none};
</script>
</head>
<body>
<ul>
<li class="one"><input type="button" onclick="show_prompt();showNext('Yahoo')" value="Google" />
<li class="two"><input type="button" id="Yahoo" onclick="show_alert();showNext('Facebook')" value="Yahoo" />
<li class="three"><input type="button" id="Facebook" onclick="show_alert1()"value="Facebook" />
</ul>
</body>
</html>