Monday, April 27, 2009

[jQuery] Re: div contains
  • -> select div but NOT li
  • your question isn't very clear . If you are trying to select based on what is inside the div these should help:

    $("div:contains("Some Text")).// do something
    or
    $("div:has(li[class=something])").// do something

    http://docs.jquery.com/Selectors


    need to be more specific what you are trying to do. The way your question is written " $("plan"). //do something " would work


    gostbuster wrote:
    Hi everyone,  I would appreciate some help with what I wanna do.  I explain my problem :  I want to do a map-like: It means a div with background images, and some elements on it (a bit like in google map : you have the map in background, and stuff you can click over it.  well i have this code :   <div id="plan">    <ul>        <li>....</li>        <li>....</li>        <li>....</li>   </ul> </div>   I would like to select #plan but NOT the li element inside.  I tried some stuff but didn't succeed.  I'm sure experts from here will solve this problem in less in a second.  Thank you VERY MUCH in advance.     

    No comments: