There is a menu
<li class="menu" id="2" onmousedown="selectProductsOnCategory(this)"> <a href="#" >плуги</a> <ul> <li class="menu" id="3" onclick="selectProductsOnCategory(this)"> <a href="#">Оборотные плуги</a> </li> <li class="menu" id="4" onclick="selectProductsOnCategory(this)"> <a href="#">Загонные плуги</a> </li> </ul> </li> And there is a script
function selectProductsOnCategory(e) { console.log(e); } Why when you click on the plows does е return 1 element that is pressed (as needed). And when you click on reversible plows or pens, it returns 2 elements (the one on which the parent (plows) was pressed). And how to make that he would return 1 item?