Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

multiplicar celulas js

$('table input').on('input', function () {
   var $tr = $(this).closest('tr'),
       tot = 1;
   $tr.find("input").each(function (i) {
      tot = tot * parseFloat(($(this).val()).replace(',', '.'));
      if(i == 1){
         $tr.find('td:last p').text(tot);
         
         var tg = 0;
         $tr.closest('table').find('tr p').not(":last").each(function(){
            tg += parseFloat(($(this).text()).replace(',', '.'));
         });
         
         $('#total_geral').text(tg);
      }
   });
   
}).trigger('input');
Source by pt.stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #multiplicar #celulas #js
ADD COMMENT
Topic
Name
9+6 =