showing results for - "reset select js"
Cael
06 Mar 2020
1$('#id').val('1');
2$('#id').trigger('change');
3
Yusuf
15 Nov 2017
1var courses = document.getElementById("special_selection");
2
3    // clear select
4    var length = courses.options.length;
5    for (i = length - 1; i >= 0; i--) {
6      courses.options[i] = null;
7    }
8    for (var i = 0; i < data.length; i++) {
9      var option = document.createElement("OPTION"),
10          txt = document.createTextNode(data[i].coursetitle);
11      option.appendChild(txt);
12      option.setAttribute("value", data[i].KF);
13      courses.insertBefore(option, courses.lastChild);
14
15    }
queries leading to this page
javascript select2 resetjavascript reset select valuejs clear select optionsjs clear options from selectreset select2 dropdown jqueryhow do i reset a select input in jshow to reset selected option on changereset dropdown jsreset select element javascriptreset selectpicker javascriptjs reset selection select dropdownhow to clear select options in javascripthow to clear select in javascriptreset select dropdown javascripthow to reset dropdown using javascriptreset select tag jsreset select element options to original list jsjavascript reset options in select box to dafaultjavascript reset select to first optionback button reset select value javascriptclear html select using javascriptjs reset a select document getelementbyidreset dropdown option with javascriptselect clear jshow to reset the select box on every button clickreset select jsreset dropdown list javascriptjs reset selectionreset isteven select with create custom resetclick on select reset the selectjs reset select elementhow to reset selected option value in javascriptjavascript form reset for selectjavascript reset select dropdownreset select option to default jshow to reset dropdown optionin jsjavascript clear select optionshow to reset select option in javascripthtml reset select element in jsclear select html javascripthow to clear select dropdown using reset htmlreset a un select en ja c2 bfvascripthow to reset dropdown selected value in javascriptjavascript function to reset selectclear select dropdown jselement select 28 29 resetreset select option javascripthow to reset dropdown in jshow to reset select dropdown in jqueryreset a select in javascriptclear select jsjs reset dropdown listhtml select input resetjavascript clear select reset select selection in htmlhow to reset dropdown selected value in javascript automaticallyreset select on changehow to reset select box value in javascriptreset select javascriptjs reset selectclear select box javascriptjs clear selection select dropdownreset select js