bootstrap click event pits encountered

bootstrap click event pits encountered

problem:

bootstrap mode generated frame, encounters click event not on the increase, for example:
In normal wording is as follows:
You will find written the Edit button (eidt_btn) click event does not take effect, or a single entry into force

    $(".eidt_btn").click(function(){
        alert(1)
    })

Correct wording:

Effect: Each class is edit_btn buttons are added alert event

    $("body").on("click",".eidt_btn",function(){
        alert(1)
    })

Summary: bootstrap click event wording

$(document).ready(function() {
	$("#父级元素id或类名").on("click", '#子元素id或类名', function() {
		//需要执行的逻辑
	});
});

By extension bootstrap other events, the same wording, if different, welcome message corrections!

Published 18 original articles · won praise 4 · Views 573

Guess you like

Origin blog.csdn.net/weixin_45538576/article/details/103119212