<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>title</title> <script src="jquery-3.3.1.min.js"></script> </head> <body> <ul> <li>111</li> <li>222</li> <li>333</li> <li>444</li> </ul> <input type="button" value="+" onclick="add()"> <script> $("ul").on("click", "li", function(){ alert(888) }) function add(){ $("ul").append("<li>555</li>") } </script> </body> </html>
<!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>title</title> <script src="jquery-3.3.1.min.js"></script> </head> <body> <p>hello p</p> </body> <script> function myhandler(e){ alert(e.data.foo) } $("p").on("click", {foo: "klvchen"}, myhandler) </script> </html>
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
css3 flex布局 justify-content:space-between 最后一行左对齐
网友评论