Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 403 Bytes

README.md

File metadata and controls

20 lines (16 loc) · 403 Bytes

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