I have the numeric value in a span (.amount), in hierarchy with other divs (.coins and .description).
What I would like to do:
1 - Copy the contents of <.amount> to a variable called $coins
2 - Update a var $total with the sum of $coins + $wallet
3 - Copy the var $total and show it in a Span with ID #total
Below is the idea of the process, but it is not a code itself.
Very thanks!
<div class="coins">
<div class="description">
<span class="amount">152</span>
</div>
</div>
<script>
var coins = 152 //content of the hierarchy class ".coins .amount"
var wallet = 1000
var total = coins + wallet
</script>
Your Total: <span id="total">$total</span>