亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

給arron這個類加了背景,為何不起作用?

<!DOCTYPE html>

<html>


<head>

? ? <meta http-equiv="Content-type" content="text/html; charset=utf-8" />

? ? <title></title>

? ? <script src="http://www.xianlaiwan.cn/static/lib/jquery/1.9.1/jquery.js"></script>

? ? <style>

? ? .test1 {

? ? ? ? background: #bbffaa;

? ? }

? ??

? ? .test2 {

? ? ? ? background: yellow;

? ? }

? ? .arron{

? ? ? ? background:red;

? ? ? ? width:500px;

? ? ? ? height:300px;

? ? }? ? ? ?此處的定義為何無效?

? ? </style>

</head>


<body>

? ? <h2>通過insertBefore與insertAfter添加元素</h2>

? ? <button id="bt1">點擊通過jQuery的insertBefore添加元素</button>

? ? <button id="bt2">點擊通過jQuery的insertAfter添加元素</button>

? ? <div class="aaron">

? ? ? ? <p class="test1">測試insertBefore,不支持多參數</p>

? ? </div>

? ? <div class="aaron">

? ? ? ? <p class="test2">測試insertAfter,不支持多參數</p>

? ? </div>

? ? <script type="text/javascript">

? ? $("#bt1").on('click', function() {

? ? ? ? //在test1元素前后插入集合中每個匹配的元素

? ? ? ? //不支持多參數

? ? ? ? $('<p style="color:red">測試insertBefore方法增加</p>', '<p style="color:red">多參數</p>').insertBefore($(".test1"))

? ? })

? ? </script>

? ? <script type="text/javascript">

? ? $("#bt2").on('click', function() {

? ? ? ? //在test2元素前后插入集合中每個匹配的元素

? ? ? ? //不支持多參數

? ? ? ? $('<p style="color:red">測試insertAfter方法增加</p>', '<p style="color:red">多參數</p>').insertAfter($(".test2"))

? ? })

? ? </script>?

</body>


</html>


正在回答

1 回答

同學,得認真檢查代碼了,aaron與arron,兩個不同,一個a一個r

1 回復 有任何疑惑可以回復我~
#1

Owlapollo 提問者

哎呀媽呀,類名我也再三確認了都沒看出來,真的要去洗洗眼了
2019-04-25 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

給arron這個類加了背景,為何不起作用?

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號