jquery - On event doesn't work -


a simple question:

when use

$(document).on('click', '.btn-del-top', function(e) {})  

everyhing work, if use

$('.btn-del-top').on('click', function(e) {})  

nothing work.is there explanation?

it because btn-del-top elements created dynamically or created after $('.btn-del-top').on('click', function(e) {}) code executed.

demo1: in case not working because code not inside dom ready


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -