textContent屬性用來讀取或設(shè)置節(jié)點(diǎn)包含的文本內(nèi)容。 innerText屬性和outerText屬性在讀取元素節(jié)點(diǎn)的文本內(nèi)容時(shí),得到的值是不一樣的。它們的不同之處在于設(shè)置一個(gè)節(jié)點(diǎn)的文本屬性時(shí),outerText屬性會(huì)使得原來的元素節(jié)點(diǎn)被文本節(jié)點(diǎn)替換掉。注意,innerText是非標(biāo)準(zhǔn)屬性,Firefox不支持。 1.innerText受CSS影響,textcontent沒有這個(gè)...
www.dbjr.com.cn/article/621...htm 2025-6-5