<div id="1">1</div> <div id="2">2</div>
<input type="checkbox">
<style> input[type="checkbox"] ~ div#d1, input[type="checkbox"]:checked ~ div#d2{ display:none; } input[type="checkbox"]:checked ~ div#d1{ display:block; } </style> <input type="checkbox"> <div id="d1">1</div> <div id="d2">2</div>