Source Code:
(back to article)
Submit
Result:
Report an issue
<!DOCTYPE html> <html> <head> <title>Title of the Document</title> <script src="https://code.jquery.com/jquery-3.5.0.min.js"></script> </head> <body> <select id="selBooks" name="books" style="font:14px Verdana;"> <option value="html">HTML Book</option> <option value="git">Git Book</option> <option value="javascript">JavaScript Book</option> <option value="css">CSS Book</option> </select> <input type="submit" id="submit" value="Remove All" /> <script> $(document).ready(function() { $("#submit").click(function() { $('#selBooks').find('option').remove(); }); }); </script> </body> </html>