Movatterモバイル変換


[0]ホーム

URL:


  1. 개발자를 위한 웹 기술
  2. Web API
  3. range

This page was translated from English by the community.Learn more and join the MDN Web Docs community.

View in EnglishAlways switch to English

range

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015년 7월.

Range 객체는 주어진 document 내의 텍스트 노드들의 부분들(parts)과 document의 단편화에 포함된 노드들을 나타내고 있다.

Range 오브젝트는Document 객체에 포함되어 있는createRange 메소드를 사용하여 생성할 수 있다. 또한selection 객체에 포함되어 있는getRangeAt 메소드를 사용하여 추출할 수 있다.

Range() 생성자 또한 사용 가능하다.

속성

collapsed

Range의 시작점과 끝점이 같인 위치인지를 알 수 있는 boolean 값을 반환한다.

commonAncestorContainer

startContainer와 endContainer 노드들을 포함한 최상위 노드를 반환한다.

endContainer

Range의 끝 위치를 포함하는 Node를 반환한다.

endOffset

endContainer 안에 있는 Range 끝을 나타내는 숫자(offset)를 반환한다.

startContainer

Range의 시작 위치를 포함하는 Node를 반환한다.

startOffset

startContainer 안에 있는 Range 시작을 나타내는 숫자(offset)를 반환한다.

생성자

Range()Experimental

Range 객체의 시작과 끝에 따라 전역Document 와 함께Range 객체를 반환한다.

메서드

상속한 메서드는 없다.

Range.setStart()

Range 의 시작 위치를 설정한다.

Range.setEnd()

Range 의 끝 위치를 설정한다.

Range.setStartBefore()

다른Node 와 관계가 있는Range 의 시작 위치를 설정한다.

Range.setStartAfter()

다른Node 와 관계가 있는Range 의 시작 위치를 설정한다.

Range.setEndBefore()

다른Node 와 관계가 있는Range 의 끝 위치를 설정한다.

Range.setEndAfter()

다른Node 와 관계가 있는Range 의 끝 위치를 설정한다.

Range.selectNode()

RangeNode 와 그것의 내용물을 포함 시킨.

Range.selectNodeContents()

RangeNode 의 내용물을 포함 시킨.

Range.collapse()

Range 의 경계 지점 중 하나로 영역을 붕괴 시킨다.

Range.cloneContents()

Range 의 노드들을 복사하여DocumentFragment 를 반환한다.

Range.deleteContents()

Document 로 부터Range 의 컨텐츠들을 삭제한다.

Range.extractContents()

Document 트리로 부터Range 의 컨텐츠들을 domxref("DocumentFragment") }} 로 이동시킨다.

Range.insertNode()

Range 의 맨 앞에Node를 삽입한다.

Range.surroundContents()

Moves content of aRange into a newNode.

Range.compareBoundaryPoints()

Compares the boundary points of theRange with anotherRange.

Range.cloneRange()

Returns aRange object with boundary points identical to the clonedRange.

Range.detach()

Releases theRange from use to improve performance.

Range.toString()

Returns the text of theRange.

Range.compareNode()지원이 중단되었습니다비표준

Returns a constant representing whether theNode is before, after, inside, or surrounding the range.

Range.comparePoint()Experimental

Returns -1, 0, or 1 indicating whether the point occurs before, inside, or after theRange.

Range.createContextualFragment()Experimental

Returns aDocumentFragment created from a given string of code.

Range.getBoundingClientRect()Experimental

Returns aClientRect object which bounds the entire contents of theRange; this would be the union of all the rectangles returned byrange.getClientRects().

Range.getClientRects()Experimental

Returns a list ofClientRect objects that aggregates the results ofElement.getClientRects() for all the elements in theRange.

Range.intersectsNode()Experimental

Returns aboolean indicating whether the given node intersects theRange.

Range.isPointInRange()Experimental

Returns aboolean indicating whether the given point is in theRange.

명세

Specification
DOM
# interface-range
DOM Parsing and Serialization
# extensions-to-the-range-interface
CSSOM View Module
# extensions-to-the-range-interface

브라우저 호환성

같이 보기

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp