Reputation: 11
Anyone know why this isn't working in Firefox?
<script type="text/javascript">
function goHo() {
hu.innerHTML="????";
}
</script>
<div class="contentPane" id="Calculator" style="display: block;">
<h2>Savings Calculator</h2><a href="Home" class="backArrow"></a>
<h3>How much do you spend on heating and hot water a year?</h3>
<div id="SpendOptions">
<ul class="optionList">
<a href="#" onMouseOut="goHo()" onMouseOver="hu.innerHTML='£60-180'"><li id="CostOption1">£600 - £900</li></a>
<a href="#" onMouseOut="goHo()" onMouseOver="hu.innerHTML='£90-240'"><li id="CostOption2">£900 - £1200</li></a>
<a href="#" onMouseOut="goHo()" onMouseOver="hu.innerHTML='£120-300'"><li id="CostOption3">£1200 - £1500</li></a>
<a href="#" onMouseOut="goHo()" onMouseOver="hu.innerHTML='£150-360'"><li id="CostOption4">£1500 - £1800</li></a>
<a href="#" onMouseOut="goHo()" onMouseOver="hu.innerHTML='£360'"><li id="CostOption5">£1800+</li></a>
</ul>
</div>
<div id="SavingsBox" style="display: block;">
<h4>This year you could save:</h4>
<h1 id="hu"></h1>
</div>
Upvotes: 1
Views: 3732
Reputation: 76238
You can also say:
<a href="#" onMouseOut="goHo('????')" onMouseOver="goHo('£60-180')">...
function goHo(html) {
document.getElementById('hu').innerHTML=html;
}
Demo: http://jsfiddle.net/8fUcG/2/
Upvotes: 0
Reputation: 6009
try:
function goHo() {
document.getElementById('hu').innerHTML="????";
}
Upvotes: 1
Reputation: 5238
You need to use document.getElementById('hu').innerHTML = "???"
Upvotes: 0
Reputation: 82058
hu
should be document.getElementById("hu")
. (Just because an item has an ID, that does not mean that it will be a declared variable (id and existence as a variable have little to do with each other))
Upvotes: 5