Did you give this a try?
if(!e)return true;//exit the function if the element is not found
if("innerHTML" in e)
e.innerHTML=parseFloat(e.innerHTML) + n1;
else if("firstChild" in e && "data" in e.firstChild)
e.firstChild.data=parseFloat(e.firstChild.data) + n1;
The only problem with this logic is that if the user keeps on changing the value of the input field and the total price will keep on adding and adding and never re-starting.
You'd best you a variable to keep track of the total.