在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ 如何快速去除網(wǎng)頁中的-moz-user-select:none 樣式?

如何快速去除網(wǎng)頁中的-moz-user-select:none 樣式?

<table style="-moz-user-select:none;-ms-user-select:none;-webkit-user-select:none;-khtml-user-select: none;table-layout:fixed;" name="GRID2" border="0" cellpadding="0" cellspacing="0">

如題,報(bào)表不讓復(fù)制每次都是進(jìn)到Developer Tools中把樣式刪除,怎么能點(diǎn)擊收藏夾里的頁簽執(zhí)行JS就清除這段樣式?

javascript:document.getElementsByTagName("table").removeAttribute("style")

這樣寫不行…

回答
編輯回答
檸檬藍(lán)

document.getElementsByTagName("table")返回的是一個(gè)元素集合(
HTMLCollection),所以要調(diào)用removeAttribute需要用到下標(biāo)

document.getElementsByTagName("table")[0].removeAttribute('style')
2018年1月5日 11:27
編輯回答
心悲涼

因?yàn)槟闶莋etElements,這是獲取多個(gè)元素的,用querySelector吧。

2017年7月21日 02:13
編輯回答
誮惜顏
document.getElementsByTagName("table")[0].style = "";
2017年12月13日 01:40