I have the following element on my page:
<div id="price">$8.00</div>
I want to be able to assign the value 8.00
to a JavaScript variable so that I can perform math on it (specifically 8.00 * .2
), and then want to take the new number and place it next to the original, while applying a line-through on the original number ONLY. So the outcome would look something like this:
$8.00 $1.60 (where the "$8.00" has a text-decoration:line-through
applied to it.)
I have been able to figure out the math and resetting the text, but I need help figuring out how to take something that's displayed, and make assign its value to a variable. I am using jQuery. Any help is appreciated.