You don't want ":has" you want a normal attribute selector.

$( '#themenu' ).children( 'li[id]' )

Karl Rudd

On Fri, Nov 7, 2008 at 11:14 AM, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> I have read the other threads on this topic, but am still getting
> nowhere ...
>
> I'm trying to make a simple (haha) show-hide menu.
> The first & last menu items are static - and don't have IDs. I need to
> select them out, otherwise I get a "g is undefined" error.
>
> Problem 1: The initial selection doesn't work
>
>        $( '#themenu' ).children( 'li:has(id)' ).hover( function() {
>                alert ( 'Got an id!' );
>        });
>
> What have I done wrong?
>
>
> Problem 2:  Getting the relevant var into my toggle statement.
>
> This works: $( '#cat2 ul' ).toggle() ;
>
> This doesn't work:
>
>                $( this.hash ).children( 'ul' ).toggle() ;
>
> This doesn't work, either:
>
>                var theID = $(this).attr('id');
>                $( '"#cat [" + theID + "] ul"' ).toggle() ;
>
> I'm at my wits' end, and desperate for your insights ....
>
>
>
>

Reply via email to