javascript - How to get sum of onload inputs -


html:

<table id="tab1">     <tr id="maint">       <td style="background-color:white;"></td>       <td>słowo klucz</td>       <td>ilość wynikow google</td>     </tr>     <tr>       <td id="maint">słowo klucz</td>       <td><input type="text" name="klucz" value="" required></td>       <td><input type="number" name="wyszkiwania" value=""  onblur="sumx()" onkeyup="operatorf()" id="eq"required></td>     </tr>     <tr>       <td id="maint">słowo klucz</td>       <td><input type="text" name="klucz" value=""></td>         <td><input type="number" name="wyszkiwania" value="" onblur="sumx()"  onkeyup="operatorf()" id="eq"required></td>     </tr>   </table> 

js:

var wejscie = document.getelementbyid('eq').value;    if ( wejscie <= 100000) {     var stawka13 = 59;     var stawka46 = stawka13*0.75;     var stawka710 = stawka46*0.55;   }   else {     var stawka13 = wejscie/100000*59;     if (stawka13 > 210) {       stawka13 = 210;     }     var stawka46 = stawka13*0.75;     var stawka710 = stawka46*0.55;   }    stawka13 = math.round(stawka13).tofixed(2);   stawka46 = math.round(stawka46).tofixed(2);   stawka710 = math.round(stawka710).tofixed(2); document.getelementbyid('sum13').innerhtml = "";   document.getelementbyid('sum46').innerhtml = "";   document.getelementbyid('sum710').innerhtml = "";   document.getelementbyid('sum13').innerhtml = " "+sum13+" zł";   document.getelementbyid('sum46').innerhtml = " "+sum46+" zł";   document.getelementbyid('sum710').innerhtml = " "+sum710+" zł"; 

i sum of eq. try arr etc aint work "properly" want. target sum of math in it. i'm not allowed add jq impotant stay on meta.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -