jQuery selector takes a second argument that sets context.

jQuery selector takes a second argument that sets context.

Hold on Cowboy

This blog post is pretty old. Be careful with the information you find in here. It's likely dead, dying, or wildly inaccurate.

I was trying to concatenate a select to the almighty

this
in jQuery, but it just wasn’t working.

I tried $(this + 'input') Didn’t work, so I thought, maybe I need a space between this and input like so: $(this + ' input') No go..

Then I ran across this page. http://stackoverflow.com/questions/306583/jquery-this-selector-and-children

Of course StackOverFlow has the answer.

The working result

$('input', this)

Perfect!!!