今天学习jQuery,一直报错但是找不到问题,求帮助

Uncaught SyntaxError: missing ) after argument list,line21
一直说我21行少个括号,但是我没发现哪里有错

代码如下:

	<script type="text/javascript">
		$(document).ready(function() {
			//1.创建与插入节点
			//创建节点,函数$(html节点),函数中的参数就是html节点的字符串
			var p = $("<p>我是p</p>")
			console.log(p)
			//内部插入
			/**
			 append(content)  向选中的节点内部追加内容
			 prepend(content) 向选中的节点内部前置内容
			 appendTo(content) 把选中的元素追加到content内部
			 prependTo(content) 把选中的元素前置到content内部
			 **/
			$(".append").click(fucntion() {
				//创建节点
				var p = $("<p>我是内部追加的p</p>")
				//把p追加给box
				$("#box").append(p)
			})

			$(".prepend").click(function() {
				$("#box").prepend($("<p>我是内部前置的p</p>"))
			})

			//追加到与前置到
			$(".appendTo").click(function() {
				$("#box2 h1").appendTo($("#box1"))
			})
			$(".prependTo").click(function() {
				$("#box2 h2").appendTo($("#box"))
			})
			
			/**
			 2.外部插入
			 after(content) 向选中的标签外部后方插入元素content
			 before(content)向选中的标签外部前方插入元素content
			 insertAfter(content) 将选中的元素插入到content元素的外部后方
			 insertbefore(content)将选中的元素插入到content元素的外部前方
			 **/
			 $(".after").click(function(){
				$("#box").after($("<p>hello p</p>"))
			 })
			 $(".insertAfter").click(function(){
			 	$(".box h2").insertAfter($("#box"))
			 })
			
			
		})
	</script>

	<style type="text/css">
		#box {
			width: 100px;
			height: 200px;
			border: 2px solid red;
		}

		#box2 {
			width: 100px;
			height: 200px;
			border: 2px solid green;
		}
	</style>
</head>
<body>
	<button type="button" class="append">内部追加</button>
	<button type="button" class="prepend">内部前置</button>
	<div id="box"></div>
	<button type="button" class="appendTo">追加到</button>
	<button type="button" class="prependTo">前置到</button>
	<div id="box2">
		<h1>我是标题1</h1>
		<h2>我是标题2</h2>
	</div>
	<button type="button" class="after">外部后方插入</button>
	<button type="button" class="insertAfter">插入到外部后方</button>
</body>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值