Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Event Custom Fire

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'));
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Event #Custom #Fire
ADD COMMENT
Topic
Name
3+1 =