I making the shops for my site, and but I can't understand why this conde don't wont to work...Here's the code:
<script>
function Price() {
    var Quantity = document.getElementsByClassName('BUY')[0].value;
    var Total = Quantity * 20;
    if (!IsNan(Total)) {
        document.getElementsByClassName('Total').innerHTML = Total;
        document.getElementsByClassName('Quantity').innerHTML = Quantity;
    } else {
        document.getElementsByClassName('Total').innerHTML = "Invalid number";
        document.getElementsByClassName('Quantity').innerHTML = 0
    }
}
Here is the html:
<input style="margin-top:1%;" type="text" name="BUY" class="input" maxlength="1000" autocomplete="on" placeholder="Buy " onchange="Price()" required>Price for <span class="Quantity">0</span>Views:<span class="Total">0</span> Satoshis<br>
From this code I expect a print of the calculation based on the quantity but the code don't work and I get no errors...
 
     
     
    