我一直在試圖找到一種方法來交換(切換)當顯示覆選框被選中時顯示的div,並返回到原始div當複選框未選中時。如何使用複選框交換DIVS
JQuery切換似乎是完美的,但現在已經貶值。所以我懷疑純JavaScript的方法可能是最好的/最簡單的。
任何幫助將大規模讚賞。
感謝,
裏克
<input name="checkbox" type="checkbox" value="checkbox">Show Hidden Div ?</p>
<div id="layerOne">This DIV is shown by default and hidden when the checkbox is checked</div>
<div id="layerTwo">This DIV is hidden by default and shown when the Checkbox is checked</div>
@putvande http://forum.jquery.com/topic/beginner-function-toggle-deprecated-what-to-use-instead – underscore
我看到了,謝謝;-) – putvande