Jump to content

onclick help


MDanz

Recommended Posts

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;

}

Link to comment
https://forums.phpfreaks.com/topic/235251-onclick-help/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.