编辑下面的代码:【加编码】
<html> <head> <script src="https://libs.baidu.com/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("#btn1").click(function(){ $("img").before("<b>Before</b>"); }); $("#btn2").click(function(){ $("img").after("<i>After</i>"); }); }); </script> </head> <body> <img src="/static/images/logo.png"> <br><br> <button id="btn1">Insert before</button> <button id="btn2">Insert after</button> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂