snipt

Ctrl+h for KB shortcuts

JavaScript

grab selected option from select element

$('#selectList').val();
https://snipt.net/embed/ab9f23364ec4895ead234c065ad7466f/
/raw/ab9f23364ec4895ead234c065ad7466f/
ab9f23364ec4895ead234c065ad7466f
js
JavaScript
1
2019-06-13T06:56:12
True
False
False
/api/public/snipt/46/
grab-selected-option-from-select-element
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nx">$</span><span class="p">(</span><span class="s1">&#39;#selectList&#39;</span><span class="p">).</span><span class="nx">val</span><span class="p">();</span> </span></pre></div> </td></tr></table>
javascript, jquery