I wish to pass a variable to a function and have the function select elements within that variable. I\'m unfamiliar with the syntax of this case however, could any one advise?>
jQuery gets a second parameter, which determines the scope of the selection. For example $('#first-name', '#registration-form') only matches elements with the first-name id inside registration-form.
I guess you can use this feature. I think $("div#element", container); would work.