I have a ul and i want create an alert when i click on a child li.
-
2021-01-28 19:06
ul
elements can only contain li
elements eventually mixed with ol
and ul
elements. You can can fix your html and jquery to be like:
$(document).on('click', '#myul ul li', function() {
alert('hey!');
});
ul,
li {
list-style-type: none;
}