I was developing a script that will update a text using javascript, unfortunately it is not working for some reason! here's the script I am using:
<script type="text/javascript">
function update(data)
{
//Ali
var a;
if(document.getElementById("level").value = "5")
{
a = 0.1;
}
if(document.getElementById("level").value == "10")
{
a = 0.35;
}
var y;
var x = data.value;
y = a * x;
document.getElementById("pricep").innerHTML == "$"+y;
}
</script>
<select class="box-select" name="level" id="level">
<option value="5">Level 5</option>
<option value="10">Level 10</option>
</select>
<!-- a lot of code -->
<input type="number" required="" placeholder="Purchase Amount" max="250" min="1" name="amount" id="refamount" value="<?php echo $_POST['amount']?>" ONCHANGE="update(this)">
<span class="box-label" id="pricep">0 USD</span>