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

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -