Right now I’m using the jQuery selector $('foo+bar'). Since I already have $('foo') stored in a variable $foo, I’d like to re-write my selector to use the $foo variable. How do you do that?
I’m looking for something simple. I’d rather burn a few CPU cycles by using code that’s easy to understand rather than write something complicated.
Use the
.next()function: