Jquery chkbox show hidden content? -
i want create multiplay chkbox, when select show hidden div, work one, how count automatically, if have more chkbox?
$(document).ready(function(){ //hide div w/id $("#extra").css("display","none"); // add onclick handler checkbox w/id checkme $("#checkme").click(function(){ // if checked if ($("#checkme").is(":checked")) { //show hidden div $("#extra").show("fast"); } else { //otherwise, hide $("#extra").hide("fast"); } }); }); <form action="" method="get"> <input name="" type="checkbox" value="" id="checkme"> <span> $1 + </span> </form> <div id="extra" style="width:10px; height:10px; background-color:#000;"> 123 </div>
try defining <div id="container">
, using
$("#container :checkbox:not(:checked)").size()
Comments
Post a Comment