Last active
          September 13, 2017 14:05 
        
      - 
      
- 
        Save developit/ee1f4ee1de3d538dc2ca6f74ac8fb77d to your computer and use it in GitHub Desktop. 
    DOM fireEvent
  
        
  
    
      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
    
  
  
    
  | function fireEvent(element, type) { | |
| let e = document.createEvent('Event'); | |
| e.initEvent(type); | |
| element.dispatchEvent(e); | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment