How to implement jquery .on() function using plain javascript and document query selectors
问题 jquery on() function allow the DOM event to trigger on an element that may be inserted in the future. How can this be implemented using plain javascript especially a mouseenter event on elements with a certain class without jquery and using modern document.querySelector 回答1: Found the answer here https://developer.mozilla.org/en-US/docs/Web/Events/mouseenter For anyone interested in implementing code is below: <ul id="test"> <li> <ul class="enter-sensitive"> <li>item 1-1</li> <li>item 1-2</li