Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<script type="text/javascript">
/*<![CDATA[*/
function mpdprice(){
var mpprice = '1';
var string = document.getElementById('quantity-input').value.replace(/\D/g,''); // remove all none digits
if (string){
if (string == '1'){
mpprice='22.80';
}
else if (string <= 24 ){
mpprice='22.08';
}
else if (string <= 49 ){
mpprice='21.36';
}
else if (string <= 99 ){
mpprice='19.93';
}
else if (string <= 249 ){
mpprice='18.49';
}
else if (string >= 250){
mpprice='17.06';
}
}
document.getElementById('matprice').innerHTML='$'+mpprice+' each';
}/*]]>*/
</script></head>
<body>
<span id="matprice">$22.80 each</span>
<input type="text" maxlength="5" value="1" id="quantity-input" onchange="mpdprice();">
</body>
</html>
Bookmarks