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".
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
Post a Comment