ÁÖ¾îÁø À§Ä¡¿¡ ÅؽºÆ® ¹üÀ§ÀÇ ½ÃÀÛ°ú ³¡ À§Ä¡¸¦ À̵¿½ÃŲ´Ù.
ÇʼöÀûÀÎ ¿ä¼ÒÀ̸ç, TextRange °³Ã¼ÀÌ´Ù.
¹Ýȯ°ªÀº ¾ø´Ù.
À§Ä¡ Æ÷ÀÎÆ®ÀÇ ÁÂÇ¥´Â Çȼ¿(pixel)´ÜÀ§À̾î¾ß Çϸé, À©µµ¿ìÀÇ ÁÂÃø »ó´Ü ¸ð¼¸®¿¡ »ó´ëÀûÀÎ À§Ä¡À̾î¾ß ÇÑ´Ù. °á°ú ÅؽºÆ® ¹üÀ§´Â ºñ¾îÀÖÁö¸¸, expand¿Í moveEnd ¸Þ¼µå¿Í °°Àº ¸Þ¼µåµéÀ» »ç¿ëÇÏ¿© ¹üÀ§¸¦ È®ÀåÇϰųª À̵¿½Ãų ¼ö ÀÖ´Ù.
ÀÌ ±â´ÉÀº Microsoft ¾Æ´Ñ Win32 Ç÷¡Æ®Æû¿¡¼´Â ÀÛ¿ëÇÏÁö ¾ÊÀ» ¼ö ÀÖ´Ù.
°³Ã¼ | script | IE |
---|
¹®¼À§¿¡¼ ÇÑ ´Ü¾î¸¦ ¼±ÅÃÇÏ¿© ¹ÝÀü½ÃÄѺ¸¶ó. moveToPoint ¸Þ¼µå·Î ¼±ÅÃµÈ ÅؽºÆ® ¹üÀ§¸¦ Ç¥ÇöÇÑ´Ù.
<SCRIPT for=document event=onclick> var rng=document.body.createTextRange(); rng.moveToPoint(window.event.x, window.event.y); rng.expand('word'); rng.select(); str='window.event.x='+window.event.x+', window.event.y='+window.event.y+'<BR>'; str+='rng.text='+rng.text; showA.innerHTML=str; </SCRIPT> <DIV id=showA>°á°ú Ç¥½Ãâ</DIV>