Thursday, April 18, 2019

JQuery: How to create element and set event listener at same time

Example:

var cell = $('<div>').on('click', function() {
$('#navigator')[0].bringPageTop('gallery.html', {
data: { pokenumber, savedPokemon }
});
})[0];


Creates a div and adds click event listener.

Reference:

No comments:

Post a Comment