這是我的代碼的JSFIDDLE。當複選框無效時,更改背景顏色並隱藏特定div中的單選按鈕
在這裏,當複選框未選中時,我需要將背景顏色變成白色並隱藏單選按鈕。當檢查
同時我想說明的背景顏色作爲當前一個並顯示單選按鈕
<div class="newsletter-box">
<span class="bonus-credit-wrapper">
<input id="bonus-credit-checkbox" name="bonus-credit-checkbox" type="checkbox" value="" />
<label for="bonus-credit-checkbox" class="bonus-credit-checkbox-label">Your bonus credits</label>
<span class="bonus-credit-description">
Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis
</span>
</span>
<span class="newsletter-preference">
<span class="newsletter-preference-text">I prefer for:
</span>
<span class="gender-radio">
<input checked id="newsletter-male" name="newsletter-gender" type="radio">
<label for="newsletter-male">Women</label>
</span>
<span class="gender-radio">
<input id="newsletter-female" name="newsletter-gender" type="radio">
<label for="newsletter-female">Men</label>
</span>
</span>
+1,很好的回答 – Sergio
@Bastian感謝您的編輯。 –