我有一系列按鈕和UL,其中所有列表項都具有內聯樣式的顯示:無。Onclick更改類的可見性
當用戶點擊一個按鈕時,我想讓某個類的任何LI都可見。舉個例子,我的代碼(!完成與非功能jQuery的)看起來像:
<script>
$(document).ready(function() {
$('.countrySelect').click(function() {
$(.Canada)
.css('display','block')
});
});
</script>
<button type="button" class="countrySelect" name="United-Kingdom">UK</button>
<button type="button" class="countrySelect" name="European-Union">EU</button>
<button type="button" class="countrySelect" name="Canada">Canada</button>
<ul>
<li><span class="United-States Hosted">Amazon Flexible Payment System</span></li>
<li><span class="United-States Hosted">Amazon Simple Pay</span></li>
<li><span class="United-States Canada Onsite">Authorize.net</span></li>
</ul>
需要大約.Canada報價是這樣的:'$(「加拿大」)' –