var test1; $(document).ready(function () { test1 = $(\"#test1ID\").jQueryPlugin(); }); var test2; $(document).ready(function () { test2 = $(\"#test2ID\").jQuery
It might be worth creating an object to hold all your "tests":
var tests = {}; $(document).ready(function () { tests.test1 = $("#test1ID").jQueryPlugin(); tests.test2 = $("#test2ID").jQueryPlugin(); }); for(i=0; i < theArrayOfStrings.length; i++){ tests[theArrayOfStrings[i]].foo(); }