How to find the selected element in a list in javascript
<p>I have a jsp that I'm working on and I need to find out which item in a list is selected.</p>

<p>here is a screen shot of the jsp:</p>

<p><img src="http://i.stack.imgur.com/fs0M0.png" alt="enter image description here"></p>

<p>here is the code:</p>

<pre><code>&lt;% Venue v = (Venue)session.getAttribute("currentVenue"); %&gt;
&lt;% List&lt;Conceptual_Package&gt; cpList = Conceptual_PackageDAO.getInstance().getByVenue(v.getId()); %&gt;

What Packages do you want to see?

 &lt;form method="post" action="ttp.actions.Sale3PackAction.action"&gt;
 &lt;select name="packid" id="packid"&gt;
     &lt;% for (Conceptual_Package cp: cpList) { %&gt;
    &lt;option value="&lt;%=cp.getId()%&gt;"&gt;&lt;%=cp.getName1()%&gt;&lt;/option&gt;
    &lt;% } %&gt;


 &lt;/select&gt;

    &lt;input type="button" value="  next  " onclick="getSeats();"/&gt;

    &lt;/form&gt;


&lt;!--new--&gt;


Available Seats:

 &lt;select name="aSeats" size="10" id="aSeats"&gt;

 &lt;/select&gt;


    &lt;input type="button" value="  add  " onclick="addToCart();"/&gt;


Selected Seats:
 &lt;form method="post" action="ttp.actions.sale4Action.action"&gt;
     &lt;select name="Seat2" size="10" id="seat2"&gt;

     &lt;/select&gt;



    &lt;/form&gt;



&lt;jsp:include page="/footer.jsp"/&gt;
</code></pre>
