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!!!

Did this help you out? It took me a few days to piece together all this information together, I hope this saves you some time (who knows, maybe the future me will be thankful I wrote this down). Let me know your thoughts. shanestillwell@gmail.com