0
this
<p>adfad</p> // value in 'this'
this.toString()
"[object HTMLParagraphElement]" // of type HTMLParagraphElement
this.outerHTML.indexOf('img') // to find 'img' tag is there
-1
如何找到某個特定節點存在'HTMLParagraphElement'
類型的Object? 除了上面提到的方法之外,還有更好的方法嗎?如何在「HTMLParagraphElement」類型的Object中找到某個特定節點?
你能提供的例子,你說的html? – Mohammad
「
adfadfadf
adfasdf
adfasdf
」 – ida請不要張貼在評論你的代碼,它是無法讀取到所有的實際目的(特別是在更長,更復雜,代碼的情況下)。 [編輯]你的問題,包括代碼,人們可以更容易地看到它。 –