I'm having a problem with some code that I typed up for a site. It works on my home computer under every browser that I have but it doesn't seem to work once I upload it.
Javascript --->
function changeText(description){
switch(description) {
case '1':
document.getElementById('describe').innerHTML = 'Travel back to the home page.';
break;
case '2':
document.getElementById('describe').innerHTML = 'Have a look at a range of websites that I have built or have had part in building.';
break;
...
default:
document.getElementById('describe').innerHTML = 'The portfolio of Ian Whitnall';
}
}
HTML --->
<div class="description_text" id="describe">
The portfolio of Ian Whitnall
</div>
<div class="nav_text"><a href="index.htm" class="nav_text" onMouseOver="changeText('1')" onMouseOut="changeText()">Home</a></div>
Can anyone see something wrong? Is there something I missed? Is case not commonly used in Javascript?
Javascript --->
function changeText(description){
switch(description) {
case '1':
document.getElementById('describe').innerHTML = 'Travel back to the home page.';
break;
case '2':
document.getElementById('describe').innerHTML = 'Have a look at a range of websites that I have built or have had part in building.';
break;
...
default:
document.getElementById('describe').innerHTML = 'The portfolio of Ian Whitnall';
}
}
HTML --->
<div class="description_text" id="describe">
The portfolio of Ian Whitnall
</div>
<div class="nav_text"><a href="index.htm" class="nav_text" onMouseOver="changeText('1')" onMouseOut="changeText()">Home</a></div>
Can anyone see something wrong? Is there something I missed? Is case not commonly used in Javascript?