I think I figured it out. It works now!!
I didn't put var in front of my variables.
I changed
Code:
price = document.getElementById("price").innerHTML;
to
Code:
var price = document.getElementById("price").innerHTML;
and did the same for the other variable and it works without errors.
Any comments on how I can make it better would be great though.