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

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么我的 js 不能動態清除 table 的 td項呢?

為什么我的 js 不能動態清除 table 的 td項呢?

胡子哥哥 2018-09-14 13:10:14
我用 elem.parentNode.removeChild(elem) 可以清除,但是自己用到項目里就不行了代碼如下:             var swipe_td_arr = document.getElementById('swiper-body').getElementsByTagName('td'); var swipe_len = swipe_td_arr.length; console.log(swipe_td_arr)for(var w = 0 ; w  < swipe_len; w++){     if(swipe_td_arr[w].innerHTML === 'undefined'){         console.log('enter undefined')         swipe_td_arr[w].parentNode.removeChild(swipe_td_arr[w])     }}
查看完整描述

1 回答

?
慕標琳琳

TA貢獻1830條經驗 獲得超9個贊

Talk is cheap, show me the code.


查看完整回答
反對 回復 2018-10-01
  • 1 回答
  • 0 關注
  • 635 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號

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