this is an object name, you want to pass the object itself and not a
string, as others have already said:

$(this).find('+ h1')
or
$('+ h1', this)
or
$(this).next('h1')

http://docs.jquery.com/Selectors

On Jul 19, 4:46 am, Dhruva Sagar <dhruva.sa...@gmail.com> wrote:
> Hi,
>
> Perhaps your missing a space? $('this h1'), or $('this ' + 'h1')
> What I don't understand is, why are you trying to concatenate two
> strings when you don't need to?
>
> ________________________________________________________________________
> Thanks & Regards,
> Dhruva Sagar.
>
> On Sat, 2009-07-18 at 22:05 -0700, Warfang wrote:
> > I'm pretty new to Javascript/ jQuery, so this is really bugging me.
>
> > I'm trying to get the height of an h1 that is a sibling to this. The
> > value for the variable h1Height, however, returned as null in the
> > console in Firebug. Perplexed, I tried console.logging ('this'+'+h1')
> > to see what it was interpreted as. It brought back this+h1, which
> > should select an h1 adjacent to this (which is a div).
>
> > Javascript
> > h1Height =  $('this'+'h1').height();
>
> > What went wrong?
>
>
>
>  draft-paper.png
> < 1KViewDownload

Reply via email to