我有以下 jQuery:
$(".score-window a:first-child").click(function() {
$(".score-window").hide();
$(".login-window").show();
});
$(".score-window a:nth-child(2)").click(function() {
$(".score-window").hide();
$(".register-window").show();
});
它与以下 HTML 相关联:
<div class="score-window">
<i class="icon-remove" title="Close"></i>
<p>In order to view your score, you have to <a href="#">log in</a>.</p><br>
<p>Don't have an account yet? <a href="#">Register</a>! Totally free and you'll get the ability to save your scores.</p>
</div>
我在课堂上只有两个链接score-window
,所以我不明白为什么这不起作用。