Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. XPathResult
  4. invalidIteratorState

XPathResult: invalidIteratorState property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨July 2015⁩.

Note: This feature is available inWeb Workers.

The read-onlyinvalidIteratorState property of theXPathResult interface signifies that the iterator has become invalid. Itistrue ifXPathResult.resultType isUNORDERED_NODE_ITERATOR_TYPE orORDERED_NODE_ITERATOR_TYPE andthe document has been modified since this result was returned.

Value

A boolean value indicating whether the iterator has become invalid.

Examples

The following example shows the use of theinvalidIteratorState property.

HTML

html
<div>XPath example</div><p>Iterator state: <output></output></p>

JavaScript

js
const xpath = "//div";const result = document.evaluate(  xpath,  document,  null,  XPathResult.ANY_TYPE,  null,);// Invalidates the iterator statedocument.querySelector("div").remove();document.querySelector("output").textContent = result.invalidIteratorState  ? "invalid"  : "valid";

Result

Specifications

Specification
DOM
# dom-xpathresult-invaliditeratorstate

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp