Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Detect DOM element insertion.
JavaScript
Branch: master
Failed to load latest commit information.
test first
README.md class add
index.js inserted fix
inserted.js inserted fix
package.json inserted fix

README.md

node-inserted

A module to detect DOM insertion. It fires a new event whenever a new element is inserted into the DOM that has the .inserted class. You can add a listener to the document to get all the insertions, or you can add a listener to the parent element. It uses the idea, published in this article.

browserify

npm install node-inserted
require('node-inserted')();

var handler = function () {
  console.log('insertion occured!');
};

document.addEventListener('inserted', handler, false); // fires on every insertion
parent.addEventListener('inserted', handler, false); // fires only when childs are inserted

plain

<script type="text/javascript" src="inserted.js"></script>
Something went wrong with that request. Please try again.