I have a div html element that has a click event set on it inline (not the way I want to do it but legacy code). See here
<div class=\"myDiv\" onclick=\"triggerJavascript();\" id=\"myDiv\">
<span id=\"text1\">Text 1<span>
<span id=\"text2\">Text 2<span>
<span id=\"text3\">Text 3<span>
<span id=\"text4\">Text 4<span>
<span id=\"text5\">Text 5<span>
What I want to do is recognize which span tag the click event originates from test5, then dont carry out the logic in triggerJavascript function, otherwise complete logic in triggerJavascript.
How can I set this up? I am working with jquery.





Rating:
The post jquery – recognize which span tag triggered javascript function in div appeared first on Javascript ASK.
via Javascript ASK http://javascriptask.phpfogapp.com/jquery-recognize-which-span-tag-triggered-javascript-function-in-div.html
No comments:
Post a Comment