Guest User

Untitled

a guest
Aug 22nd, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3. jQuery(document).ready(function() {
  4. var values = $('#input_2_86,#input_2_129,#input_2_95,#input_2_96').change(function() {
  5. var sum = 0;
  6. values.each(function() { // Step through each one
  7. var value = parseInt($(this).val(), 10); // Retrieve its numeric value
  8. sum += (isNaN(value) ? 0 : value); // Add to the total
  9. });
  10. $('#input_2_88').val(sum / 4); // And show the average
  11. });
  12. });
  13. </script>
Add Comment
Please, Sign In to add comment