How to get <select> options either (value or text) using jQuery
<p>i have a code for</p>

<pre><code>&lt;select id='list'&gt;
    &lt;option value='1'&gt;Option A&lt;/option&gt;
    &lt;option value='2'&gt;Option B&lt;/option&gt;
    &lt;option value='3'&gt;Option C&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>and i want that how ever i select any option, it will show in an alert message.
i have try </p>

<pre><code>&lt;script type='text/javascript'&gt;

    //var value = $("#list option[value=2]").text();
    //var value = $("#list option:selected").text();
    //var value = $('#list').val();
    var value = $(this).val();
    alert(value);

&lt;/script&gt;
</code></pre>

<p>but fail.</p>
