Binding events for newly loaded tags in jQuery

Method 1: Put the statement that binds the event when it is loaded, and it will be loaded together with the label.
$('li')click(function()( ) ) Method 2: Set a proxy for this label, that is, pass a constant Element to replace it, eg: need to add binding for li $('ul').on('click','li',function()()) is to use ul to proxy li events




Guess you like

Origin blog.csdn.net/weixin_49549509/article/details/108231838