»ç¿ëÀÚ°¡ °³Ã¼ÀÇ ³»¿ëÀ» ÆíÁýÇÒ ¼ö Àִ°¡¸¦ ºÎ¿ï°ªÀ¸·Î ¹ÝȯÇÑ´Ù.
¼±ÅÃÀûÀÎ ¼Ó¼º°ªÀº ¿¤·¹¸àÆ®¸¦ »ç¿ëÀÚ°¡ ÆíÁýÇÒ ¼ö ÀÖ°¡¸¦ ³ªÅ¸³»´Â ºÎ¿ï°ªÀÌ´Ù.
true | ¿¤·¹¸àÆ®¸¦ »ç¿ëÀÚ°¡ ÆíÁýÇÒ ¼ö ÀÖ´Ù. |
false | ¿¤·¹¸àÆ®¸¦ »ç¿ëÀÚ°¡ ÆíÁýÇÒ ¼ö ¾ø´Ù. |
ÀÌ ¼Ó¼ºÀº ÀбâÀü¿ëÀÌ¸ç µðÆúÆ®°ªÀº ¾ø´Ù.
°³Ã¼ | script | HTML | ±Ô°Ý | IE |
---|
<BODY id=bodyObj> <SCRIPT> document.write('isContentEditable='+bodyObj.isContentEditable) </SCRIPT>
ÆíÁýÇÒ ¼ö ÀÖ´Â Å×À̺í
Á¦¸ñ1 |
Á¦¸ñ2 |
---|---|
ÁÙ1 - Ä1 µ¥ÀÌÅÍ |
ÁÙ1 - Ä2 µ¥ÀÌÅÍ |
ÁÙ2 - Ä1 µ¥ÀÌÅÍ |
ÁÙ2 - Ä2 µ¥ÀÌÅÍ |
<P>ÆíÁýÇÒ ¼ö ÀÖ´Â Å×À̺í</P> <TABLE BORDER=1 WIDTH=80%> <THEAD><TR><TH><DIV contenteditable style="height:100%;width:100%;">Á¦¸ñ1</DIV></TH> <TH><DIV contenteditable style="height:100%;width:100%;">Á¦¸ñ2</DIV></TH></TR> </THEAD> <TBODY> <TR><TD><DIV id=divObj contenteditable style="height:100%;width:100%;">ÁÙ1 - Ä1 µ¥ÀÌÅÍ</DIV></TD> <TD><DIV contenteditable style="height:100%;width:100%;">ÁÙ1 - Ä2 µ¥ÀÌÅÍ</DIV></TD> </TR> <TR><TD><DIV contenteditable style="height:100%;width:100%;">ÁÙ2 - Ä1 µ¥ÀÌÅÍ</DIV></TD> <TD><DIV contenteditable style="height:100%;width:100%;">ÁÙ2 - Ä2 µ¥ÀÌÅÍ</DIV></TD> </TR> </TBODY> </TABLE> <SCRIPT> document.write('divObj.isContentEditable='+divObj.isContentEditable) </SCRIPT>
<DIV id=org></DIV><BR> <BUTTON ID="butObj" onclick="changeIt()">ÆíÁý ºÒ°¡´ÉÇÏ´Ù.</BUTTON><BR> <SPAN ID="myObj" style="border:solid 1 blue;color:blue">ÀÌ ¹®ÀÚ¿À» ÆíÁýÇØ º¸¶ó.</SPAN><BR> myObj.contentEditable=<SPAN ID="curVal" style="color:blue"></SPAN> <SCRIPT> curVal.innerText=myObj.isContentEditable; org.innerHTML='myObj.contentEditable='+myObj.contentEditable+'<BR>myObj.isContentEditable='+myObj.isContentEditable; function changeIt() { currentState=myObj.isContentEditable; newState=!currentState; myObj.contentEditable=newState; curVal.innerText=newState; if(newState==true){ butObj.innerText='ÆíÁý °¡´ÉÇÏ´Ù.'; } else { butObj.innerText='ÆíÁý ºÒ°¡´ÉÇÏ´Ù'; } } </SCRIPT>
<SCRIPT> allCol=document.all; str='<TABLE width=600 border=1><TR><TH></TH><TH>.nodeName</TH><TH>.id</TH><TH>.innerText</TH></TR>'; str+='<COL><COLGROUP style=text-align:center><COL><COL><COL></COLGROUP>'; for (i=0;i< allCol.length;i++){ if (allCol[i].isContentEditable){ str+='<TR><TD>document.all['+i+']</TD><TD>'+allCol[i].nodeName+'</TD>'; str+='<TD>'+allCol[i].id+'</TD><TD>'+allCol[i].innerText+'</TD></TR>'; } } str+='</TABLE>'; document.write(str); </SCRIPT>