I have written a function that works when I click li.defaul
(it is highlighted on the screen)

enter image description here


It functions the same way when I click on the child input block. enter image description here

Task: not to let the function execute when clicking on the child block
The function itself:

var changeCell; $('.default').mousedown(function(){ setTimeout(function() { $('#address-input').focus(); }, 100); changeCell = $(this).attr('id'); if ($('#'+changeCell).children().length == 0) { $('#'+changeCell).append('<div></div>'); } }); 

1 answer 1

Inside iventa used e.target : if (this === e.target) ...