ÇÑ ¹üÀ§°¡ ´Ù¸¥ °³Ã¼ ¼Ó¿¡ Æ÷ÇԵǾî Àִ°¡¸¦ ³ªÅ¸³»´Â °ªÀ» ¹ÝȯÇÑ´Ù.

Àμö/ÆĶó¸ÞÅÍ
oRange
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, Æ÷Ç﵃ ¼ö ÀÖ´Â TextRange °³Ã¼ÀÌ´Ù.
¹Ýȯ°ª

¹Ýȯ°ª bValÀº ÇÑ ¹üÀ§°¡ ´Ù¸¥ °³Ã¼¿¡ Æ÷ÇԵǾú´Â°¡¸¦ ³ªÅ¸³»´Â ºÎ¿ï°ªÀÌ´Ù.

true oRange°¡ ¸Þ¼­µå¸¦ È£ÃâÇÑ TextRange °³Ã¼¿¡ Æ÷ÇԵǾî Àְųª µ¿ÀÏÇÏ´Ù.
false oRange°¡ ¸Þ¼­µå¸¦ È£ÃâÇÑ TextRange °³Ã¼¿¡ Æ÷ÇԵǾî ÀÖÁö ¾Ê´Ù.
Ư±â

ÀÌ ±â´ÉÀº Microsoft ¾Æ´Ñ Win32 Ç÷¡Æ®Æû¿¡¼­´Â ÀÛ¿ëÇÏÁö ¾ÊÀ» ¼ö ÀÖ´Ù.

Àû¿ë
°³Ã¼scriptIE
ÂüÁ¶
isEqual

hasOwnProperty ¼Ó¼º ¿¹Á¦ 1

°á°ú Ç¥½Ãâ

inRange ¸Þ¼­µå·Î µÎ°³ÀÇ TextRange °³Ã¼¸¦ ºñ±³ÇÑ´Ù.

<HTML>
<HEAD>
<SCRIPT>
function doCheck1(){
  var oRng1=document.body.createTextRange();
  var oRng2=oRng1.duplicate();
  str='oRng1.inRange(oRng2)='+oRng1.inRange(oRng2)+'<BR>oRng1.text.length='+oRng1.text.length+'<BR>';
  str+='oRng2.inRange(oRng1)='+oRng2.inRange(oRng1)+'<BR>oRng2.text.length='+oRng2.text.length;
  showA.innerHTML=str;
}
</SCRIPT>
</HEAD>
<BODY>
<BUTTON onclick="doCheck1()">Ŭ¸¯ÇÏ¿© °ËÁ¤</BUTTON>
<DIV id=showA>°á°ú Ç¥½Ãâ</DIV>
</BODY>
</HTML>

hasOwnProperty ¼Ó¼º ¿¹Á¦ 2

div1 ³»¿ë
div2 ³»¿ë
°á°ú Ç¥½Ãâ

moveToElementText ¸Þ¼­µå·Î À̵¿½ÃÅ°°í inRange ¸Þ¼­µå·Î °ËÁ¤ÇÑ´Ù.

<HTML>
<HEAD>
<SCRIPT>
function doCheck2(){
  var oRng1=document.body.createTextRange();
  var oRng2=oRng1.duplicate();
  oRng1.moveToElementText(div1);
  oRng2.moveToElementText(div2);
  str='oRng1.inRange(oRng2)='+oRng1.inRange(oRng2)+'<BR>oRng1.text='+oRng1.text;
  str+='<SPAN style=width:2em></SPAN>div1.innerText='+div1.innerText+'<BR>';
  str+='oRng2.text='+oRng2.text;
  str+='<SPAN style=width:2em></SPAN>div2.innerText='+div2.innerText+'<BR>';
  showB.innerHTML=str;
}
</SCRIPT>
</HEAD>
<BODY>
<DIV id=div1>div1 ³»¿ë</DIV>
<DIV id=div2>div2 ³»¿ë</DIV>
<BUTTON onclick="doCheck2()">Ŭ¸¯ÇÏ¿© °ËÁ¤</BUTTON>
<DIV id=showB>°á°ú Ç¥½Ãâ</DIV>
</BODY>
</HTML>

hasOwnProperty ¼Ó¼º ¿¹Á¦ 3

°á°ú Ç¥½Ãâ

inRange ¸Þ¼­µå·Î ¼­·Î ´Ù¸¥ µÎ TextRange °³Ã¼¸¦ ºñ±³ÇÑ´Ù.

<HTML>
<HEAD>
<SCRIPT>
function doCheck3(){
  var oRng1=document.body.createTextRange();
  var oRng3=oRng1.duplicate();
  oRng3.findText('div1 ³»¿ë');
  str='oRng1.inRange(oRng3)='+oRng1.inRange(oRng3)+'<BR>';
  str+='oRng3.inRange(oRng1)='+oRng3.inRange(oRng1)+'<BR><BR>';
  str+='oRng1.text.length='+oRng1.text.length+'<BR>';
  str+='oRng3.text.length='+oRng3.text.length+' ('+oRng3.text+')';
  showC.innerHTML=str;
}
</SCRIPT>
</HEAD>
<BODY>
<BUTTON onclick="doCheck3()">Ŭ¸¯ÇÏ¿© °ËÁ¤</BUTTON>
<DIV id=showC>°á°ú Ç¥½Ãâ</DIV>
</BODY>
</HTML>