1. add-dom-event-listener
add dom event listener. normalize ie and others
add-dom-event-listener
Package: add-dom-event-listener
Created by: yiminghe
Last modified: Mon, 13 Jun 2022 02:25:23 GMT
Version: 1.1.0
License: MIT
Downloads: 2,696,730
Repository: https://github.com/yiminghe/add-dom-event-listener

Install

npm install add-dom-event-listener
yarn add add-dom-event-listener

add-dom-event-listener

add dom event listener. normalize ie and others. port from https://github.com/modulex/event-dom

NPM version
build status
Test coverage
gemnasium deps
node version
npm download

examples

 var addEventListener = require('add-dom-event-listener');
var handler = addEventListener(document.body, 'click', function(e){
  console.log(e.target); // works for ie
  
  console.log(e.nativeEvent); // native dom event
});
handler.remove(); // detach event listener

history

1.1.0

  • allow event options

Dependencies

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin