Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $('select.example1, input.example1').change(function() {
- console.log($(this).val());
- countExample1();
- });
- $('button.example1').click(function() {
- countExample1();
- });
- function countExample1() {
- var total = 0;
- $('select.example1').each(function() {
- total += parseFloat($(this).val());
- });
- if ($('input.example1').is(':checked')) total += 1;
- $('div.example1').html('Total: '+total);
- }
- });
Add Comment
Please, Sign In to add comment