View Full Version : quikie: where to find script

04-28-2006, 03:34 PM
hi, just a quick one! i'm after a simple script that 'toggles' show/hide more info on a page as can be seen here (http://search.reviews.ebay.co.uk/Help-Us-Spread-The-Message_EAN_0780661001720_W0QQfvcsZ1277QQsoprZ3959070) (click the link "more information").

i've searched the readymadeJava (http://www.javascriptkit.com/cutpastejava.shtml) page and have had no luck, but i'm pretty sure i've seen it here a while back, if i'm not mistaken? cant seem to find it anymore

04-28-2006, 04:26 PM
Basic idea:

function toggleDisplayInfo(id){
document.getElementById(id).style.display = (document.getElementById(id).style.display == "block")?"none":"block";

<a href="#" onclick="toggleDisplayInfo('someid');return false;">Show/Hide</a>
<div id="someid" style="display:none;">asdf</div>

fyi: untested and typed here,