更新时间:2023-11-30 19:36:04
它被称为'冒泡'。按钮位于div内部,因此它正在执行按钮,然后向上链接到div。在按钮功能中添加event.stopPropagation()。
It's called 'bubbling'. The button is inside the div so it's executing button then up the chain to div. Add event.stopPropagation() inside the button function.
$("#"+comListID+"btn").click(function(event){
event.stopPropagation();
addNewArr(comListID);
});