extending the jquery .each loop
<p>I have a jQuery function that finds all the images nested in a container DIV with the ID of #popupForm, looks at the SRC attribute and compares it to a hidden input that has it's value created by a server side variable. Once rendered if there's a match it'll do a replace on the SRC of the image, hense:</p>

<pre><code>var thisTheme = $("#hiddenTheme").val();
var defaultTheme = "/midway/firstTheme/"

$('#popupForm img').each(function () {

    var thisSRC = $(this).attr('src');
    if (thisSRC.indexOf(defaultTheme) !== -1) {

        var new_src = $(this).attr('src').replace(defaultTheme, thisTheme);
        $(this).attr('src', new_src);

    }

});
</code></pre>

<p>Now this works great but I wish to extend the loop part of this code (the .each part) so not only does it look at images in the container DIV but all inputs (yes some of the inputs have a SRC attribute - please don't ask why)</p>

<p>I was thinking of adding an array like such </p>

<pre><code>var arrValues = ["#popupForm img", "#popupForm input"];
</code></pre>

<p>and then chaning the selector partof the each to contain the array, something like this</p>

<pre><code>$(arrValues).each(function () {
</code></pre>

<p>Does anyone know the best way for me to amend the code for this, what I've tried thus far hasn't worked!</p>

<p>Thanks</p>
