I need javascript to add 5 to an integer variable, but instead it treats the variable as a string, so it write out the variable, then add 5 onto the end of the "string". How can I force it to do math instead?  var dots = document.getElement...
I am trying to learn Javascript. Here I am confused with the following code.  http://rendera.heroku.com/usercode/eae2b0f40cf503b36ee346f5c511b0e29fc82f9e  When I put x+y in the function it is going wrong. For example 2+2=22, 5+7=57  But /, *, - are...
I have the following code which interprets the numbers as strings and adds them like 100300 instead of 400:  var rate = document.getElementById('pur_price').value; var pprice = document.getElementById('pur_price').value; var rate1 = d...
I wrote this code as part of a calculator, for practice. It mostly works as intended.  However, the add operation concatenates the two numbers instead of adding them. Why?  function calcApp (aNumber, bNumber) {     var a = prompt("Enter A number...
Please, take a brief look at the code below:  <script type="text/javascript"> function recentpostslist(json) {  document.write('<ul class="recommended">');  var i;  var j;  for (i = 0; i < json.feed.entry.length...
Is it possible to add a integer to a scope variable?    e.g    <div style="top:{{top + 140}}px">....</div>     If top is 140 it should give me "280px" and not "140140px"    Is this possible?...
I encountered this problem while trying to add the values of 6 different input, I noticed that if I add 3 of them it works, but if I add more than 3 values it doesn't work.  When I add 3 values between them, everything seems to work correctly but...
I have the following function:   function addChange(result, bill) {   for (var i=0;i<result.length;i++) {     if (result[i][0] === bill[0]) {       result[i][1] = parseFloat(result[i][1]).toPrecision(2) + parseFloat(bill[1]).toPrecision(2);...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.