hi

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • chanmyiewintun@gmail.com

    hi

    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
  • P. Prikryl

    #2
    Re: hi

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

    Some sample code:
    document.getEle mentById("paren t-element-identifier").on click =
    function(e) {
    e = e || window.event;
    var target = e.target || e.srcElement;

    alert(target + " was clicked!");
    }

    Comment

    Working...