最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

新增的節(jié)點(diǎn)不能輸入內(nèi)容;如何讓新增的行可以輸入內(nèi)容

新增的節(jié)點(diǎn)不能輸入內(nèi)容;

如何讓新增的行可以輸入內(nèi)容???

正在回答

3 回答

<input type='text' />

tb標(biāo)簽的innerHTML屬性加入上面那個(gè)就可以輸入內(nèi)容

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

http://img1.sycdn.imooc.com//59504d0d0001981f07810283.jpg你貼出來(lái)運(yùn)行一下看看

<!DOCTYPE html>

<html>

?<head>

? <title> new document </title> ?

? <meta http-equiv="Content-Type" content="text/html; charset=gbk"/> ??

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

??

? ? ? window.onload=function(){

var tr = document.getElementsByTagName("tr");

for(var i=0;i<tr.length;i++){

bcgChange(tr[i]);

}

? ? ? ? ? }

? ? ? function bcgChange(obj){

? ? ? obj.onmouseover=function(){obj.style.backgroundColor="#f2f2f2";}

? ? ? ? ? ?obj.onmouseout=function(){obj.style.backgroundColor="#fff";}

? ? ? }

? ?function del(obj){

? obj.parentNode.parentNode.parentNode.removeChild(obj.parentNode.parentNode);

? ?}


? ??

? ??

? ? ?

? ? ? // 編寫(xiě)一個(gè)函數(shù),供添加按鈕調(diào)用,動(dòng)態(tài)在表格的最后一行添加子節(jié)點(diǎn);

? ? function add(){

? ? ? ? ? ?var tableNode = document.getElementById("table");

? ? ? ? ? ?var newTr = document.createElement("tr");

? ? ? ? ? ? ? ?for(var i = 0;i<2;i++){

? ? ? ? ? ? ? ? ? ?var newTd = document.createElement("td");

? ? ? ? ? ? ? ? ? ?newTr.appendChild(newTd);

? ? ? ? ? ? ? ? ? ?}

? ? ? ? ? ? ? ?var newTd3 = document.createElement("td");

? ? ? ? ? ? ? ?var a = document.createElement("a");

? ? ? ? ? ? ? ?a.href="javascript:;";

? ? ? ? ? ? ? ?a.setAttribute("onclick","del(this)");

? ? ? ? ? ? ? ?a.innerHTML="刪除";

? ? ? ? ? ? ? ?newTd3.appendChild(a);

? ? ? ? ? ? ? ?newTr.appendChild(newTd3);

? ? ? ? ? ?tableNode.appendChild(newTr);

? ? ? ? ? ? var tr = document.getElementsByTagName("tr");

? ? ? ? ? ? for(var i=0;i<tr.length;i++){

? ? ? ? ? ? bcgChange(tr[i]);

? ? ? ? ? ? ? ? }


? ? ? ? }

? ? ?

? ??



? </script>?

?</head>?

?<body>?

? <table border="1" width="50%" id="table">

? <tr>

<th>學(xué)號(hào)</th>

<th>姓名</th>

<th>操作</th>

? </tr> ?


? <tr>

<td>xh001</td>

<td>王小明</td>

<td><a href="javascript:;" onclick="del(this)">刪除</a></td> ? <!--在刪除按鈕上添加點(diǎn)擊事件 ?-->

? </tr>


? <tr>

<td>xh002</td>

<td>劉小芳</td>

<td><a href="javascript:;" ?onclick="del(this)">刪除</a></td> ? <!--在刪除按鈕上添加點(diǎn)擊事件 ?-->

? </tr> ?


? </table>

? <input type="button" value="添加一行" onclick="add()" /> ? <!--在添加按鈕上添加點(diǎn)擊事件 ?-->

?</body>

</html>


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

有代碼嗎?

一般用innerHTML屬性來(lái)賦值的

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

慕粉3796571 提問(wèn)者

這里不能貼不下;我在下面回復(fù)貼出來(lái)了,你有空進(jìn)去看一下
2017-06-26 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

新增的節(jié)點(diǎn)不能輸入內(nèi)容;如何讓新增的行可以輸入內(nèi)容

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

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

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