Paul's Javascript Notes
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
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment