jQuery, only fire if li is clicked on and NOT an a tag -
i have following setup
<ul> <li><a href="http://www.example.com">example</a></li> <li><a href="http://www.example2.com">example2</a></li> </ul>
the li's have width set css 400px;
i'm trying write jquery fires if li clicked, not tag.
suggestions?
when event in click handler, @ event.target / event.originaltarget
this should give indication element caused event , can either process or ignore it.
function clickhanlder (e) { if (e.target.tagname != "a") { return; } }
Comments
Post a Comment