Thanks. You could achieve this with a simple for loop: var min = 12, See: What is the best way to add options to a select from an array with jQuery? $('#mySelect') :grinning_face_with_big_eyes: Im not aware of a way to do what you want. When user clicks on an option in the select list, its value is added in the textbox. If the textbox is empty, or there is already an option with HTMLSelectElement.selectedOptions. This Javascript post was going to be about language selection in FCKEditor from a drop down box as a follow up to the previous FCKEditor post but Ive decided to postphone that post until Friday and look at how to add options to an HTML : . Double-click the image or text you want to paste. The fourth parameter sets the options actual selected state - if set to true, the new option will be selected by default. appear in the list, and the second the v That is the right choice. By clicking Accept all cookies, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. If you want to add a CSS class to an existing HTML element, but only if it doesn't already exist, you can, fortunately, do this easily using vanilla JavaScript. The one thing I'd avoid is doing DOM operations in a loop to avoid repeated re-renderings of the page. When the list is primarily used to select one or more values, a should be used with , which map to role="listbox" and role="option", respectively. select = document.getElementById('selectElementId'); "https://code.jquery.com/jquery-3.1.0.js". Add an option to select. Use jQuery DOM Element to Add New Options in JavaScript. Clone with Git or checkout with SVN using the repositorys web address. To be honest, you Two parallel diagonal lines on a Schengen passport stamp, Looking to protect enchantment in Mono Black, "ERROR: column "a" does not exist" when referencing column alias, Comprehensive Functional-Group-Priority Table for IUPAC Nomenclature. 1. var selectElement = document.getElementById ('ageselect'); for (var age = 12; age <= 100; age++) { selectElement.add (new Option (age, age)); } Your age: