°³Ã¼ÀÇ ³»¿ëÀÌ ÀбâÀü¿ëÀΰ¡¸¦ ºÎ¿ï°ªÀ¸·Î ¹ÝȯÇϰųª ¼³Á¤ÇÑ´Ù.
false | µðÆúÆ®À̸ç, °³Ã¼°¡ ÀбâÀü¿ëÀÌ ¾Æ´Ï´Ù. |
true | °³Ã¼°¡ ÀбâÀü¿ëÀÌ´Ù. |
ÀÌ ¼Ó¼ºÀº Àбâ/¾²±â·Î µðÆúÆ®°ªÀº falseÀÌ´Ù.
°³Ã¼ÀÇ readOnly ¼Ó¼ºÀÌ trueÀ̸é, »ç¿ëÀÚ°¡ ÅؽºÆ®¸¦ ÀÔ·ÂÇϰųª ¼öÁ¤ÇÒ ¼ö ¾ø´Ù. ¼Ó¼º°ªÀÌ true·Î ¼³Á¤µÇ¾ú´õ¶óµµ disabled°¡ ¾Æ´Ï¸é Ç×»ó ÃÊÁ¡À» ¹ÞÀ» ¼ö ÀÖ´Ù.
°³Ã¼ | script | HTML | ±Ô°Ý | IE |
---|
ÀÌ ¼Ó¼ºÀº HTML 4.0°ú (¿µ¹®) W3C DOM Level 1(Document Object Model)¿¡¼ Á¤ÀǵǾú´Ù.
¼Ó¼º°ªÀ» º¯°æ½ÃÅ°¸é¼ ÀÔ·ÂÀ» ½ÃµµÇØ º¸¶ó.
<FORM name="formObj"> <INPUT type="text" id="textObj" value="ÀÔ·Â ¹®ÀÚ¿"> <INPUT type="password" id="pwdObj" value="¾ÏÈ£ ¹®ÀÚ¿"> <TEXTAREA id="taObj">ÀÔ·Â ¹®ÀÚ¿</TEXTAREA> <P><BUTTON onclick="showAll()">readOnly ¹Ù²ã º¸±â</BUTTON> </FORM> </P> <DIV id="showA">°á°ú Ç¥½Ãâ</DIV> <SCRIPT> function showAll(){ if (formObj.textObj.readOnly) formObj.textObj.readOnly=formObj.pwdObj.readyOnly=formObj.taObj.readOnly=false else formObj.textObj.readOnly=formObj.pwdObj.readyOnly=formObj.taObj.readOnly=true; str='formObj.textObj.readOnly='+formObj.textObj.readOnly+'<BR>'; str+='formObj.pwdObj.readyOnly='+formObj.pwdObj.readyOnly+'<BR>'; str+='formObj.taObj.readOnly='+formObj.taObj.readOnly+'<BR>'; showA.innerHTML=str; } </SCRIPT>