Created
April 28, 2020 03:12
-
-
Save robertoandres24/5818c63d974875ccae8ada149b9cbe20 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var select = document.querySelector('#sel'), | |
input = document.querySelector('input[type="button"]'); | |
select.addEventListener('change',function(){ | |
alert('changed'); | |
}); | |
input.addEventListener('click',function(){ | |
select.value = 2; | |
select.dispatchEvent(new Event('change')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment