title: how to display Value On select change in jsp
body: <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;style&gt;
              div { color:red; }
          &lt;/style&gt;
          &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;select name="sweets" multiple="multiple"&gt;
              &lt;option&gt;Chocolate&lt;/option&gt;
              &lt;option selected="selected"&gt;Candy&lt;/option&gt;    
              &lt;option&gt;Taffy&lt;/option&gt;
              &lt;option selected="selected"&gt;Caramel&lt;/option&gt;
              &lt;option&gt;Fudge&lt;/option&gt;
              &lt;option&gt;Cookie&lt;/option&gt;    
          &lt;/select&gt;
          &lt;div&gt;&lt;/div&gt;
          &lt;script&gt;
              $("select").change(function() {
                  var str = "";
                  $("select option:selected").each(function() {
                      str += $(this).text() + " ";
                  });
                  $("div").text(str);
              }).change();
          &lt;/script&gt;    
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This my code I want to display on console in jsp on Select change passing the value.I want to Print onslected item in Jsp page </p>
  
  <pre><code>&lt;%  
      String k=request.getParameter("sweets");
      out.println(k);
  %&gt;
  </code></pre>
  
  <p>Like this I want to Print on select item data please help me</p>