Here are two methods for which you can use DOM(Document Object Model) to use values within html forms.
<html><body>
<script>
function get_price(value){
var price1 = document.getElementById(“myid”).value;
//return true;
alert(“Price is: $”+ price1 + “.00”);
window.location.reload();
return true;
}
</script>
<div>Hats
<form>
<input type=”text” id=”myid” name=”myid” value=”25″/>
<input type=”button” id=”thebutton” name=”thebutton” onclick=”get_price(this.form.myid.value)”/>
</form></div><div style=”clear:both;”></div>
</body></html>
<html><body>
<script>
function get_price(){
var price1 = document.getElementById(“myid”).value;
alert(“Price is: $”+ price1 + “.00”);
window.location.reload();
return true;
}
</script>
<div>Hats
<form>
<input type=”text” id=”myid” name=”myid” value=”25″/>
<input type=”button” id=”thebutton” name=”thebutton” onclick=”get_price()”/>
</form></div><div style=”clear:both;”></div>
</body></html>
© 2018 ALL Rights Reserved | Sitemap
Vancouver | North Vancouver | Burnaby | Richmond | Coquitlam | Port Coquitlam | Surrey | Langley | Maple Ridge | Mission | Abbotsford | Kamloops | Kelowna | Victoria | Squamish | Whistler | Pemberton