 <p>Not sure what you thought was going on in the <code>handleLists</code> part of your script. You just need to wrap the other segment in an iterator (<code>forEach</code>) after finding the elements corresponding to the IDs.</p> <pre><code>var idList= ["MeatList", "Seats", "Lastname"].map(function(id){return document.getElementById(id)}); idList.forEach(function(select){ [].slice.call(select.options) .map(function(a){ if(this[a.value]){ select.removeChild(a); } else { this[a.value]=1; } },{}); }); </code></pre> <p>Of course, this is bad. You should make de-duplicating a function of it's own, eg.:</p> <pre><code>function deDuplicate(select){ [].slice.call(select.options) .map(function(a){ if(this[a.value]){ select.removeChild(a); } else { this[a.value]=1; } },{}); } </code></pre> <p>and then:</p> <pre><code>var idList= ["MeatList", "Seats", "Lastname"].map(function(id){return document.getElementById(id)}); idList.forEach(function(select){ deDuplicate(select); }); </code></pre> <p>Personally I recommend learning/using CoffeeScript as it <em>uncrufts</em> Javascript a great deal, the de-dupe looks like this:</p> <pre><code>deDuplicate = (select)-&gt; [].slice.call(select.options).map (a)-&gt; if @[a.value] select.removeChild a else @[a.value] = 1 , {} </code></pre> <p>and then wrapped you can do:</p> <pre><code>deDuplicate select for select in ["MeatList", "Seats", "Lastname"].map (id)-&gt; document.getElementById id </code></pre> <p>Which reads more plainly as english, at least to me it does. As always YMMV.</p>