The .is() function only tests the first element of a jQuery object.
What you want to do is "filter" the list and see if there's anything
in it after the filter (or a normal "select" via $()).

For your example:

if ( $('a#f_' + ide).siblings().filter('img').length )
{
  // do this action
}
else
{
  // do something else
}

Now that test will be "true" (ie not 0) on HTML like this:

<something>
  <a id="f_something" ...>Blah</a>
  <img ...>
</something>

If you want to check whether a link contains an 'img' then use:

if ( $('a#whatever img').length ) {
  // contains an img
}

Karl Rudd

On 8/29/07, Txt.Vaska <[EMAIL PROTECTED]> wrote:
>
> I'm trying to determine if soemthing has been set on the page...and
> if it is do a different action. I have...
>
> if ($('a#f_' + ide).siblings().is('img'))
> {
>    // do this action
> }
> else
> {
>    // do something else
> }
>
> Which looks to see if an image exists in
>
> I'm expecting that .is() will return true in some cases but it never
> does.
>
> Am I going about this entirely the wrong way?
>
> Thanks
>

Reply via email to