Forum Moderators: open
<TD ID=shoppingBasketOrderTotalCell>£15.43</TD>
I would like to be able to get the £15.43 value.
This is my script code...
var theBasketTotalNode =document.getElementByID("shoppingBasketOrderTotalCell");
var orderVal=theBasketTotalNode.firstChild.nodeValue;
However all I get is a script error in IE 5.2 for the Mac
What am I doing wrong? I am sure it is something very obvious but I can't just find what!
Thanks
You just have a typo - capitalisation problem.
If this doesn;t work then the problem is within the Mac version of IE - it's notoriously buggy. This works in PC IE and decent browsers like Mozilla/Firebird
<html><body>
<table><tr><TD ID="shoppingBasketOrderTotalCell">£15.43</TD></tr></table>
<script>
var theBasketTotalNode = document.getElementById("shoppingBasketOrderTotalCell");
var orderVal=theBasketTotalNode.firstChild.nodeValue;
alert(orderVal)
</script></body></html>