Hi I would like to if anyone of you an help me find a javascript for my websites FAQ section I want to use the some what the same script as used by http://www.megaupload.com/?c=faq Looking forward for your help
It's easy <script> var image = { "on" : "images/on.png", "off" : "images/off.png" } function toggleContent(divId, imageId){ if(document.getElementById(div).style.display == 'none'){ document.getElementById(div).style.display = 'block'; document.getElementById(imageId).src = image['off']; }else{ document.getElementById(div).style.display = 'none'; document.getElementById(imageId).src = image['on']; } } </script> Code (markup): The usage is this: <a href='#' onClick='toggleContent("info1", "infoImage1")'><img src='images/on.png'> Show Info</a> <div id="info1">Some Info</div> Code (markup):