Skip to content

heeju/custom-event-trigger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

How to use

var div = document.getElementsByTagName('div')[0];

//add custom event listener
div.addEventListener('test', function(event) {
	alert(event.type + "/" + event.detail);
}, false);


// or jQuery
/*
$(div).on('test', function(event) {
	alert(event.type + "/" + event.originalEvent.detail)
});
*/

//fire custom event
div.trigger('test', 'custom value'); //event.detail

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published