title: Reading option values in select
body: <p>I have select values as follows:</p>
  
  <pre><code>&lt;select id="SelectBox" multiple="multiple"&gt;
  
              &lt;% foreach (var item in Model.Name)
              { %&gt;
                  &lt;option value="&lt;%= item.Value %&gt;"&gt;&lt;%=item.Text%&gt;&lt;/option&gt;
              &lt;% } 
              %&gt;
  
              &lt;/select&gt;
  </code></pre>
  
  <p>I have a function in jquery that will have to read both the text and value. I need to have the values in array so that I can display them in a table with a column Id and another column text.  My problem is that I<code>m not able to retrieve each and every value separately.  I</code>m having the text in one line, test1test2test3.</p>
  
  <pre><code>function read() {
              $("#SelectBox").each(function() {
                  var value = $(this).val();
                  var text = $(this).text();
                  alert(value);alert(text);
  
              });
          }
  </code></pre>