Select element using variable not id in JQuery
<p>How to write below statement</p>

<pre><code>if ($('#SelectedItems option[value=' + optionData.Value + ']').length === 0) ;
</code></pre>

<p>using the variable</p>

<pre><code>var selectedItems = $('#SelectedItems');

//Something like this but not exactly

if ($(**selectedItems** + "option[value=' + optionData.Value + ']").length === 0) ;
</code></pre>
