10 examples of 'select onchange' in JavaScript

Every line of 'select onchange' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
11function onChange(e) {
12 const newValue = e.target.value;
13 props.onChange(newValue);
14}
254registerOnChange(fn) {
255 this.propagateChange = fn;
256}
213registerOnChange(fn: (_: any) => void) {
214 this.onChange = fn;
215}
36function onChange(event) {
37 var elem = event.target,
38 value = self.options[$(elem).prop('selectedIndex')];
39
40 self.eventEmitter.emit('change', value[0]);
41}
38changedSelect(obj) {
39 this.select.emit(obj);
40}
15function handleSelectChange(e) {
16 if (e && e.target && e.target.value) {
17 handleChange(e.target.value, selectFor);
18 }
19}
24onChange(e){
25 const { setItems } = this.props
26 const key = e.target.value
27 setItems([key])
28}
186public registerOnChange(fn: (value: any) => void) {
187 this.onChange = fn;
188}
154function selectChangeEvent(e) {
155
156 // an item has been selected on the regular select we created
157 // check to make sure it's not an IE screwup, and add it to the list
158
159 if(msie > 0 && msie < 7 && !ieClick) return;
160 var id = $(this).children("option:selected").slice(0,1).attr('rel');
161 addListItem(id);
162 ieClick = false;
163 triggerOriginalChange(id, 'add'); // for use by user-defined callbacks
164}
129function selectChangeEvent(e) {
130
131 // an item has been selected on the regular select we created
132 // check to make sure it's not an IE screwup, and add it to the list
133 if(ieVersion() < 7 && !ieClick) return;
134 var id = $(this).children("option:selected").slice(0,1).attr('rel');
135 addListItem(id);
136 ieClick = false;
137 triggerOriginalChange(id, 'add'); // for use by user-defined callbacks
138}

Related snippets