How do I pass arguments to my JavaScript function?
<p>I have this JavaScript function:</p>

<pre><code>function prefixOneDropDown(){

        var source = $('#prefix-one');
        var selected = source.find('option[selected]');
        var options = $('option', source);  
        var DefinitionList = '&lt;dl id="dd-prefix-one" class="dropdown f-left"&gt;&lt;dt&gt;&lt;a href="#"&gt;' + selected.text() + '&lt;span class="value"&gt;' + selected.val() + '&lt;/span&gt;&lt;/a&gt;&lt;/dt&gt;&lt;dd&gt;&lt;ul&gt;&lt;/ul&gt;&lt;/dd&gt;&lt;/dl&gt;';
        $(DefinitionList).insertAfter(source);

        options.each(function(){ $("#dd-prefix-one dd ul").append('&lt;li&gt;&lt;a href="#"&gt;&lt;span class="number-plate"&gt;' + $(this).text() + '&lt;/span&gt;&lt;span class="value"&gt;' + $(this).val() + '&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;'); });
    }
</code></pre>

<p>I was wondering if there is a way declaring <code>var selected, options, DefinitionList</code> outside the function...then call them in as arguments? </p>

<p>I've tried a number of different approaches but I'm missing something.</p>

<p>The function is called in my js like so : <code>prefixOneDropDown();</code></p>

<p>Any help would be Greatly Appreciated, Thanks</p>
