jQuery - how to determine which link was clicked

前端 未结 4 1212
一向
一向 2021-01-23 18:34

I have a simple piece of PHP which generates n copies of the following code:

4条回答
  •  面向向阳花
    2021-01-23 19:14

    Here is a cross-browser way to find the element (target) that triggered the event (e):

    function getTarget(e){
    // non-ie or ie?
    e=e||window.event;
    return (e.target||e.srcElement);
    };
    

提交回复
热议问题