Here is the JavaScript:
function unhide(divID) {
var item = document.getElementById(divID);
if (item) {
item.className=(item.className=='hidden')?'unhidden':'hidden';
}
}
Here is the HTML:
<a href="javascript:unhide('verizon');">VERIZON<br>
<a href="javascript:unhide('sap');">SAP</a><br>
<div id="sap" class="hidden">
<embed src="videos/sap.mov" height="270" width="480" scale="tofit"></embed>
</div>
<div id="verizon" class="hidden">
<embed src="videos/verizon.mov" height="270" width="480" scale="tofit"></embed>
</div>
When I click on SAP the video plays. When I click on Verizon it also plays but the SAP video continues to play even though it is hidden.
I am very new to javascript.
Is there a better way to do this? How do I fix with the code I already have?