代码编辑器:
x
1
2
<meta charset="utf-8">
3
<link href="/static/next/css/tryit.css?v=2017082407" rel="stylesheet"/>
4
<script src="https://cdn.staticfile.org/jquery/2.2.4/jquery.min.js"></script>
5
<script>
6
$(document).ready(function(){
7
$("#btn1").click(function(){
8
$("img").before("<b>之前</b>");
9
});
10
$("#btn2").click(function(){
11
$("img").after("<i>之后</i>");
12
});
13
});
14
</script>
15
<img src="/images/logo.png" >
16
<br><br>
17
<button id="btn1">之前插入</button>
18
<button id="btn2">之后插入</button>