MDanz Posted May 1, 2011 Share Posted May 1, 2011 onclick isn't working... information should be displayed in the div with id='info' echo "<div id='$id' style='display:none;'>$name - $information</div>"; echo "<div class='productcol' onclick='Info($id)'><img src='$image' alt='$name' style='width:95px;height95px;' /></div>"; echo "<div id='info'></div>"; function Info(number) { var information = document.getElementById(number).innerHTML; document.getElementByID('info').innerHTML = information; } Quote Link to comment https://forums.phpfreaks.com/topic/235251-onclick-help/ Share on other sites More sharing options...
gristoi Posted May 1, 2011 Share Posted May 1, 2011 youve got the div's style set to hidden. So it wont diplay enything until you add the display block to it Quote Link to comment https://forums.phpfreaks.com/topic/235251-onclick-help/#findComment-1208958 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.