You could use the 'style' property of to achieve what you are looking for. Within the style property you could set display:none, to hide the . To make it visible again, just change display back to display:inline when a button gets clicked. Try the following:
Project2Favorite Animals
οnmοuseοver="this.style.backgroundColor='red';"
οnmοuseοut="this.style.backgroundColor='white';"
οnclick="
document.getElementById('sloth').style='width:200px;height:150px;display:none;'
document.getElementById('slow').style='width:200px;height:150px;display:inline;'
document.getElementById('outputDiv').innerHTML=
'This animal might look like a harmless, big-eyed baby ewok, but ' +
'the slow loris is one of the only venomous mammals in the world. ' +
'Its subtle nature makes it popular in the illegal pet trade, but this ' +
'furry creature also carries a toxin that is released from the brachial ' +
'gland on the sides of its elbows. If threatened, the loris can take ' +
'the toxin into its mouth and mix it with saliva. The animal may also ' +
'lick or rub its hair with this mixture to deter predators from attack. ' +
'The toxin can cause death by anaphylactic shock in some people.';">
οnmοuseοver="this.style.backgroundColor='red';"
οnmοuseοut="this.style.backgroundColor='white';"
οnclick="
document.getElementById('slow').style='width:200px;height:150px;display:none';
document.getElementById('sloth').style='width:200px;height:150px;display:inline;'
document.getElementById('outputDiv').innerHTML=
'Sloths—the sluggish tree-dwellers of Central and South America—spend ' +
'their lives in the tropical rain forests. They move through the canopy ' +
'at a rate of about 40 yards per day, munching on leaves, twigs and buds. ' +
'Sloths have an exceptionally low metabolic rate and spend 15 to 20 hours ' +
'per day sleeping. And surprisingly enough, the long-armed animals are ' +
'excellent swimmers. They occasionally drop from their treetop perches ' +
'into water for a paddle.'">
Edit
If you don't mind changing your code a bit, a cleaner solution would be:
Project2Favorite Animals
This animal might look like a harmless, big-eyed baby ewok, but
the slow loris is one of the only venomous mammals in the world.
Its subtle nature makes it popular in the illegal pet trade, but this
furry creature also carries a toxin that is released from the brachial
gland on the sides of its elbows. If threatened, the loris can take
the toxin into its mouth and mix it with saliva. The animal may also
lick or rub its hair with this mixture to deter predators from attack.
The toxin can cause death by anaphylactic shock in some people.
Sloths—the sluggish tree-dwellers of Central and South America—spend
their lives in the tropical rain forests. They move through the canopy
at a rate of about 40 yards per day, munching on leaves, twigs and buds.
sloths have an exceptionally low metabolic rate and spend 15 to 20 hours
per day sleeping. And surprisingly enough, the long-armed animals are
excellent swimmers. They occasionally drop from their treetop perches
into water for a paddle.
οnmοuseοver="this.style.backgroundColor='red';"
οnmοuseοut="this.style.backgroundColor='white';"
οnclick="
document.getElementById('slow').style='text-align:center;display:inline';
document.getElementById('sloth').style='text-align:center;display:none'">
οnmοuseοver="this.style.backgroundColor='red';"
οnmοuseοut="this.style.backgroundColor='white';"
οnclick="
document.getElementById('sloth').style='text-align:center;display:inline';
document.getElementById('slow').style='text-align:center;display:none'">