I am using this code in my application:
document.getElementById("inventory_box").innerHTML = "<img src='./img/rock.gif' id='test' />";
The #inventory_box
element is present already, so it just spews out the IMG
into #inventory_box
.
What I want is to be able to click this appeared IMG
with id name test
,
but won't work like:
$("#test").click(function() {
// Run this
});