Code:
<button class="del-btn">
<i class="layui-icon"></i>
</button>
$(".del-btn").on("click", function () {
alert("");
});
question:
this button is shown above. Click on the area outside the text, and the click event will trigger normally, but clicking on the text will not work. At first, I thought it was the problem with the jQuery library, so the code was changed to this:
<button class="del-btn" onclick="alert("")">
<i class="layui-icon"></i>
</button>
the result is still the same. Please answer the question from friends who have encountered similar questions. Except for the text area, there is no problem. The click icon will trigger click, normally. Why is the text invalid?