OK i'll try this right now, Actually, here is the aim :
Image a Map with places : when you click somewhere on the map, you can add a place when you click on a place, you can edit it and do some stuff. That's why I don't have to prevent the click from <li> (=places). I'll try now and give you news! Thanks On 27 avr, 19:50, Ricardo <ricardob...@gmail.com> wrote: > That's because the click event from a LI bubbles up to the DIV. Two > simple ways to avoid it: > > $('#plan').click(function(e){ > //abort if a LI was clicked > if ( $(e.target).is('li') ) > return false; > > //then do stuff() > > }); > > (alternatively use if ( e.target.id != 'plan' )) > > or a less efficient but explanative way: > > $('#plan').click(function(){ > //do stuff}); > > $('#plan li').click(function(e){ //or #plan > * > return false; > //returning false calls e.stopPropagation() and e.preventDefault > () > }); > > cheers, > - ricardo > > On Apr 27, 10:26 am, Remon Oldenbeuving <r.s.oldenbeuv...@gmail.com> > wrote: > > > It looks obvious, but aint working for me. > > > On Mon, Apr 27, 2009 at 3:16 PM, Mauricio (Maujor) Samy Silva < > > > css.mau...@gmail.com> wrote: > > > > De: "gostbuster" <jeremyescol...@gmail.com> > > > Assunto: [jQuery] Re: div contains <li> -> select div but NOT li > > > Hi, > > > Yes of course I could do this, but Jquery selectors don't allow what I > > > wish to do? > > > Thanks. > > > > ------------------------------------------------------------------------------ > > > How about: > > > $('#plan').not('ul').click(function(){...} > > > Maurício