Skip to content

jQuery plugin that runs handler function once specified element is inserted into the DOM.

License

Notifications You must be signed in to change notification settings

dmhendricks/jquery-waituntilexists

Repository files navigation

License NPM Downloads jsDelivr Hits DigitalOcean Twitter BrowserStack

jquery.waitUntilExists.js

jQuery plugin that runs handler function once specified element is inserted into the DOM.

Original author: Brandon Belvin

npm install @dmhendricks/jquery-waituntilexists

Usage

<script src="https://cdn.jsdelivr.net/npm/@dmhendricks/jquery-waituntilexists/jquery.waitUntilExists.min.js"></script>
$( '#selector' ).waitUntilExists( function() {

	// Perform some logic
	console.log( $( this ).attr( 'id' ) );

	// Optionally remove the listener when finished
	$( this ).waitUntilExists( 'remove' );

});

Analytics

About

jQuery plugin that runs handler function once specified element is inserted into the DOM.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published