このブラウザ バージョンのサポートは終了しました。サポートされているブラウザにアップグレードしてください。
とある要素が document につながっているかどうかを調べたい! とりあえず、ほとんどすべてのブラウザで出来る方法としては、 parentNode で確認することができますね。 function isElementInDocument(node) { do { if (node === document) { return true; } } while (node = node.parentNode) return false; } でも 前の例だとちょっと遅いので contains や、 compareDocumentPosition を使うといいです! コードにすると以下のような感じ function isElementInDocument(node) { if (document === node) { return true } else if (document.compa
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く