is :checked not working while using Jquery 1.7 -
look @ simple code
html
<input type="checkbox" id="check" > <span id="rm">remember me</span> <span id="ok">okay!</span>
css
#ok{ position:absolute; font:italic bold 14px century; color:green; margin-left:3px; margin-top:2px; display:inline-block; opacity:0; }
jquery
if($('#check').is(":checked")) { $("#ok").css("opacity",1); }
http://jsfiddle.net/milanshah93/4hf9t/
it not working when check box.
your checkbox not checked on page load. although can -
$("#check").on('change', function () { if ($(this).is(":checked")) { $("#ok").css("opacity", 1); } else{ $("#ok").css("opacity", 0); } });
Comments
Post a Comment