title: Fetching only selected values from CrossSelect of Jquery
body: <p>In below screen shot there are 2 boxes where user will select from left box to right which ever items he want. Now which ever the column selected by the user in the right box. I need only those items.. 
  Below is the screen shot and code.In the below screen shot 
  i need to get only one,two and three values from right box.So, how to get only selected items from the right box?</p>
  
  <p>To Fetch the right box values is this the right menthod in JavaScript Function. Please help</p>
  
  <pre><code>function export()
      {                 
           &lt;%if(request.getParameter("myServersID1") != null)
          {
                String[] ItemNames;
  </code></pre>
  
  <p>ItemNames =   request.getParameterValues("myServersID1"); </p>
  
  <pre><code>              for(int i = 0; i &lt; ItemNames.length; i++)
  
                {
                       String selecteditems;
  
                       selecteditems= ItemNames[i];
  
                     System.out.println("selecteditems" +selecteditems);
  
          }}%&gt;
  
          alert("selectcol"); 
  
      }   
  </code></pre>
  
  <p>when button is added</p>
  
  <pre><code>&lt;input type="button" value="Export" class="btn-arrow-pri btn-small" style="margin-left: 300px;" onclick="export();"/&gt;
  </code></pre>
  
  <p><em><strong></em>__<em>_</em></strong>      <strong><em>_</em>___</strong></p>
  
  <pre><code>four   |    |
  
         |&gt;   |one
  
  five   |&lt;   |two
  
         | &gt;&gt; |three
  
         |&lt;&lt;  |
  </code></pre>
  
  <h2>                <strong><em>_</em>___</strong></h2>
  
  <p>CODE is:</p>
  
  <pre><code>&lt;html&gt;
  [...]
  &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"&gt;&lt;/script&gt;
  
    &lt;script type="text/javascript"&gt;
  
      function moveRight(){
          $(document).ready(function(){
              $("#myserversID option:selected").appendTo("#myserversID1")
          });
      }
  
      function moveLeft(){
          $(document).ready(function(){
              $("#myserversID1 option:selected").appendTo("#myserversID")
          });
      }
  
    &lt;/script&gt;
   &lt;/head&gt;
   &lt;body&gt;
  
  &lt;select size="8" id="myserversID" multiple="multiple"&gt;
      &lt;option value="one"&gt;one&lt;/option&gt;
      &lt;option value="two"&gt;two&lt;/option&gt;
      &lt;option value="three"&gt;three&lt;/option&gt;
      &lt;option value="four"&gt;four&lt;/option&gt;
      &lt;option value="five"&gt;five&lt;/option&gt;
      &lt;option value="six"&gt;six&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;input type="button" value="Move Right" onclick="moveRight();"/&gt;
  &lt;input type="button" value="Move Left" onclick="moveLeft();"/&gt;
  &lt;select size="8" id="myserversID1" multiple="multiple"&gt;  
  &lt;/select&gt;
   &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>