How to show value of checked checkbox?
<html>
<input type="checkbox" class="check"> Smart Survical<br>
<input type="checkbox" class="check"> Smart Survical<br>
<input type="checkbox" class="check"> Smart Survical<br>
<input type="checkbox" class="check"> Smart Survical<br>
<li><input type="text" name="WIS" value="0">Cart</li>
<script src="
http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".check").click(function(){
if( $(this).is(':checked') ) {
$(":input[name='WIS']").val( parseFloat($(":text[name='WIS']").val()) + 1 );
} else {
$(":input[name='WIS']").val( parseFloat($(":text[name='WIS']").val()) - 1 );
}
});
});
</script>
</html>
</body>
Currently this is showing number in text field but I want to show number with this link instead of text field.For example when 2 check box is selected there should Cart(2) when three Cart(3) and so on.When no check box is selected i want only Cart.
Thanks