В JQuery я могу сделать:
Код: Выделить всё
$(document).on("click","a.someBtn",function(e){
console.log("hi");
});
Очевидно, что следующее не работает:
Код: Выделить всё
query.addEventListener( "click", someListener );
What I would like to do is compare the item by query selectors. I am selecting the element that does not exist yet with querySelectorAll. It is a little more dynamic than just checking the tag name.
Источник: https://stackoverflow.com/questions/306 ... la-javascr