select option trigger in js
/*html*/
<select id="sel" onchange='alert("changed")'>
<option value='1'>One</option>
<option value='2'>Two</option>
<option value='3' selected>Three</option>
</select>
/*Function js*/
var select = document.querySelector('#sel'),
input = document.querySelector('input[type="button"]');
select.addEventListener('change',function(){
alert('Yare yare daze');
});
/*RESULT*/
/*When change value trigger alert('Yare yare daze') */
Also in JavaScript:
- check if value is a string javascript
- $(document).on in javascript
- Exception in thread "main" org.openqa.selenium.JavascriptException: cannot read getPlayerState
- regex for lowercase letters js
- javascript write to text file stack overflow
- infinite image slider with react and node js
- upgrade nodejs ubuntu
- JavaScript OOP
- using fb login with angular app
- javascript is object
- react $ r component instance console
- iterate through object array javascript
- conditional array element js
- javscript remove a property
- javascript show stack trace
- removes null and false values from an array
- react merge two objects
- error: Error: Unable to resolve module `crypto` from `node_modules\crypto-js\core.js`: crypto could not be found within the project.
- jquery check checkbox
- vue js tutorial
- react documentation
- firestore batch add array
- declare function javascript
- this.setstate is not a function in react native