$("a:empty").text(":empty")和$("a:empty").html(":empty")有什么區(qū)別?
$("a:empty").text(":empty")和前面出現(xiàn)的$("a:empty").html(":empty")效果一樣,
有什么區(qū)別?
$("a:empty").text(":empty")和前面出現(xiàn)的$("a:empty").html(":empty")效果一樣,
有什么區(qū)別?
2017-02-24
舉報(bào)
2017-02-24
html()包括文本標(biāo)簽和其他的html標(biāo)簽,text()只針對(duì)文本節(jié)點(diǎn)
2017-02-24
$("a:empty")這個(gè)選取就是空的a標(biāo)簽,所以通過.text()或者h(yuǎn)tml()添加的內(nèi)容就是一樣的了!