第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

為什么我拷貝會越來越多?這樣寫為什么不對?

<!DOCTYPE html>

<html>


<head>

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

? ? <title></title>

? ? <script src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script>

</head>


<body>

? ? <div>

? ? ? ? <input id="input" type="button" value="粘貼一個新的text" />

? ? ? ? <p id="txt">hello world</p>

? ? </div>

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

? ? ? ? //克隆節(jié)點

? ? //克隆事件

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

? ? ? ? ? ? if(!$("#txt").length)

? ? ? ? ? ? return;

? ? ? ? ? ? $("#txt").append($("#txt").clone(true).css('color','blue') )

? ?})

? ? </script>

</body>


</html>


正在回答

3 回答

改成div是將p元素添加到div中,而前面你的寫法是將它添加到了p元素中

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

Lucia_Huang 提問者

非常感謝!
2016-12-26 回復(fù) 有任何疑惑可以回復(fù)我~

那把那個地方改成div

0 回復(fù) 有任何疑惑可以回復(fù)我~

因為你最后用的 id 是txt呀,你應(yīng)該換成 this.http://img1.sycdn.imooc.com//5860d1e30001666204750171.jpg

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

Lucia_Huang 提問者

this不是那個按鈕嗎? 我是想每點擊一下按鈕,讓hello world出來一個。請大神指教
2016-12-26 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

為什么我拷貝會越來越多?這樣寫為什么不對?

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號