By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,299 Members | 1,141 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,299 IT Pros & Developers. It's quick & easy.

hi

P: n/a
i would like to know how can i check which dynamically created
object(icon) was clicked in javascript?can u help me?
i want some sample code
Jun 27 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You can check the target/srcElement property of the click event
handled by function of the parent element.

Some sample code:
document.getElementById("parent-element-identifier").onclick =
function(e) {
e = e || window.event;
var target = e.target || e.srcElement;

alert(target + " was clicked!");
}
Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.