Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>New document</title>
<style type="text/css">
div{
width: 55px;
height: 25px;
border: 1px black solid;
text-align:center;
float:left;
}
.bare{
border: 0px white;
}
</style>
</head>
<body>
<div class="bare">price</div><div class="price">45.87</div>
<div class="points"></div><div class="bare">points</div>
<div class="bare">price</div><div class="price">93.28</div>
<div class="points"></div><div class="bare">points</div>
<script type="text/javascript">
var divs=document.getElementsByTagName("div");
for (var i = 0; i < divs.length; i++) {
if(divs[i].className=="price"){
divs[i+1].innerHTML=Math.floor(divs[i].innerHTML);
}
}
</script>
</body>
</html>
I don't really get the bit about the points being worth 5p - if that's the case why do you get 19 if you are spending £19.99?