Follow along with the video below to see how to install our site as a web app on your home screen.
Бележка: This feature may not be available in some browsers.
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(event){
$('.calc').click(function(){
var total = 0;
$('.calc:checked').each(function(){
total += parseInt($(this).val());
});
alert(total);
});
});
</script>
</head>
<body>
<input type="checkbox" name="items[]" id="item1" class="calc" value="1" />1<br />
<input type="checkbox" name="items[]" id="item2" class="calc" value="2" />2<br />
<input type="checkbox" name="items[]" id="item3" class="calc" value="3" />3<br />
</body>
</html>