As it is possible to make so that at a choice in there was a complete list - option . But when some option selected - remove all other options? Preferably in juqery .
When something is chosen:
As it is possible to make so that at a choice in there was a complete list - option . But when some option selected - remove all other options? Preferably in juqery .
When something is chosen:
Use the filter :not(селектор) - removes everything except the specified selectors
$(document).ready(function () { $('#select').change(function () { $('#select option:not(#select option:selected)').remove(); }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> <select id="select"> <option value="s1">s1</option> <option value="s2">s2</option> <option value="s3">s3</option> </select> Source: https://ru.stackoverflow.com/questions/594370/
All Articles