css - HTML - Is it possible to uncheck all the other checkboxes when you check one checkbox? -


basically im building gallery, pure css. when press image1 check checkbox1 , div1 appear. have done already, problem is, if press image2 div2 appear, if press image1 again div1 not appear because div2 in front of it.

html:

<div class="gallery"> <label for="toggle1"><a>1</a></label> <input id="toggle1" type="checkbox"> <label for="toggle2"><a>2</a></label> <input id="toggle2" type="checkbox"> <label for="toggle3"><a>3</a></label> <input id="toggle3" type="checkbox"> <label for="toggle4"><a>4</a></label> <input id="toggle4" type="checkbox"> <label for="toggle5"><a>5</a></label> <input id="toggle5" type="checkbox"> <label for="toggle6"><a>6</a></label> <input id="toggle6" type="checkbox"> <label for="toggle7"><a>7</a></label> <input id="toggle7" type="checkbox"> <label for="toggle8"><a>8</a></label> <input id="toggle8" type="checkbox"> <div class="conteudo1">1</div> <div class="conteudo2">2</div> <div class="conteudo3">3</div> <div class="conteudo4">4</div> <div class="conteudo5">5</div> <div class="conteudo6">6</div> <div class="conteudo7">7</div> <div class="conteudo8">8</div> </div> 

i not post css because didnt found how can indent code automatically, can see here: http://jsfiddle.net/blackice856/3vhch/1/

basically need when checkbox1 checked, uncheck other checkboxes, , reapeat remain checkboxes.

i never liked javascript much, did , took me 10 minutes lol, still want know if there way of doing it.

thanks time (:

yes. you'll need write javascript uncheck other boxes. html provides similar functionality radio boxes, mu short said


Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -