jquery - How to select option with double click? -


how make select option selectable double click?

e.g. double click "option text #3" , value of option 3 shall written hidden input field id="selectedoption".

enter image description here

you can use dblclick way:

$('select option').dblclick(function() {    $('#selectedoption').val(this.outerhtml);  });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <select size="4">    <option>option # 1</option>    <option>option # 2</option>    <option>option # 3</option>    <option>option # 4</option>  </select>    <input type='text' id='selectedoption' value=''>


Comments

Popular posts from this blog

java - Run spring boot application error: Cannot instantiate interface org.springframework.context.ApplicationListener -

python - pip wont install .WHL files -

Excel VBA "Microsoft Windows Common Controls 6.0 (SP6)" Location Changes -