DHTML °³Ã¼µé¿¡ ¸¶½ºÅ©µÈ ÆíÁý ºñÇìÀ̹ö¸¦ Á¦°øÇÑ´Ù.

script object.style.behavior="url('mask.htc')";
object.addBehavior("mask.htc");
HTML <INPUT style="behavior:url('mask.htc')" id=idVal>
XML ¾øÀ½
Ư±â

window.onload À̺¥Æ®°¡ ¹ß»ýµÇ±â Àü¿¡´Â ½ºÅ©¸³Æ®·Î ¾Æ·¡ ¼Ó¼ºÀ̳ª À̺¥Æ®¿¡ Á¢¼ÓÇÒ ¼ö ¾ø´Ù. ¹®¼­°¡ ¿ÏÀüÈ÷ ·ÎµùµÇ°í, onload À̺¥Æ®°¡ ¹ß»ýµÇ¸é ÇØ´ç ÆäÀÌÁöÀÇ ºñÇìÀ̹ö°¡ Àû¿ëµÇ°í, ¸ðµç ¼Ó¼º, ¸Þ¼­µå, À̺¥Æ®¸¦ ½ºÅ©¸³Æ®·Î »ç¿ëÇÒ ¼ö ÀÖ´Ù. À̺¥Æ® ¹ß»ýÀü¿¡ ½ºÆ®¸³Æ®·Î °³Ã¼¿¡ Á¢¼ÓÀ» ½ÃµµÇÏ¸é ½ºÆ®¸³Æ®´Â ±× ¼Ó¼ºÀÌ °³Ã¼¿¡¼­ Áö¿øµÇÁö ¾Ê´Â´Ù´Â ¿À·ù¸¦ ¹ß»ý½ÃŲ´Ù.

mask ÆíÁý ºñÇìÀ̹ö´Â input ¿¤·¹¸àÆ®¿¡ Àû¿ëµÇ°í, Á¦ÇÑµÈ ÀԷ°ú ¾ç½ÄÈ­µÈ Ãâ·ÂÀ» À§ÇÑ ÀÔ·ÂÇÒ ¼ö ÀÖ´Ù. Á¤º¸°¡ ÀԷµǸé ÀԷ»çÇ×ÀÌ µð½ºÇ÷¹À̵ǰí, Ʋ¸° ÀÔ·ÂÀ» ¾Ë·ÁÁØ´Ù. ÀÌ ºñÇìÀ̹ö´Â »çÀü¿¡ ¼³Á¤µÈ(preset) ¾ç½ÄÀ» ÅëÇÏ¿© ¸¶½ºÅ©µÈ ¾ç½Ä¿¡µû¶ó ÀÏÀÚ, ½Ã°£, ÀüÈ­¹øÈ£µî ¿©·¯°¡Áö ÀÔ·Â Çʵ忡 »ç·æµÉ ¼ö ÀÖ´Ù.


attribute property ¼³¸í
preset mask ºñÇìÀ̹ö¿¡¼­ ÀÔ·Â À¯Áö ¸¶½ºÅ©¸¦ ¹ÝȯÇϰųª ¼³Á¤ÇÑ´Ù.

À̺¥Æ® ¼³¸í
onerror mask ºñÇìÀ̹ö¿¡¼­ Àбâ Àü¿ë ¼Ó¼º¿¡ °ªÀ» ÇÒ´çÇϰųª ¼Ó¼º°ª¿¡ À¯È¿ÇÏÁö ¾ÊÀº °ªÀÌ ÇÒ´çµÇ¸é ¹ß»ýµÈ´Ù.

Àû¿ë
°³Ã¼ IE
<INPUT style="behavior:url('mask.htc')" id=idVal> IE5(win32,unix)

onsave·Î Áñ°Üã±â¿¡ ÀúÀåµÇ°í onload À̺¥Æ®Ã³¸®ÀÚ·Î ¹®¼­·Î ·ÎµùµÈ´Ù. setAttribute ¸Þ¼­µå·Î ´Ù¸¥ °³Ã¼µéÀ» Æ÷ÇԾƿ© ÀÔ·Â °³Ã¼¿Í ±× °ªÀ» Áñ°Üã±â¿¡ À¯Áö¸¦ ¼³Á¤ÇÑ´Ù. °ªÀÌ À¯ÁöµÇ±â À§Çؼ­´Â Ŭ¶ó½º·Î ÁöÁ¤µÈ class="mask"À̾î¾ß ÇÑ´Ù.

<BUTTON
  onclick="window.open('../behavior/exp/wmask.html','_new','width=460,height=380')">¿¹Á¦ º¸Á¶Ã¢ ¿­±â
</BUTTON>
exp/wmask.html ÄÚµå
<!DOCTYPE html public "-//w3c//dtd html 4//en">
<HTML>
<HEAD>
<TITLE>¾ð¾î ÂüÁ¶ - Javascript - ºñÇìºñ¾î(behavior) - Mask ºñÇØÀ̹ö ¿¹Á¦</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=euc-kr">
<LINK rel="stylesheet" type="text/css" href="../../public/jscript.css">
<META name="save" content="history">
<STYLE>
.mask{ behavior:url("../../behavior/exp/mask.htc");color:brown;font-weight:bold;font-size:11pt:}
</STYLE>
</HEAD>

<BODY>
<TABLE width=440>
<TR><TD>
<DIV style="border:solid 1 blue;background:fff;text-align:center;width:100%;margin:5">
<H3><SPAN class=titleblue><SPAN class=behavior>mask</SPAN> ºñÇØÀ̹ö ¿¹Á¦</SPAN></H3>
</DIV>
<TABLE>
<COL style=color:navy><COL style=color:blue><COL style=color:teal>
<TR><TD>ªÀº ÀÏÀÚ:</TD><TD><INPUT type="text" class="mask" preset="shortdate"></TD><TD>11/12/2004</TD></TR>
<TR><TD>Áß°£ ÀÏÀÚ:</TD><TD><INPUT type="text" class="mask" preset="mediumdate"></TD><TD>12/Nov/2004</TD></TR>
<TR><TD>±ä ÀÏÀÚ:</TD><TD><INPUT type="text" class="mask" preset="longdate"></TD><TD>December/11/2004</TD></TR>
<TR><TD>È­Æó:</TD><TD><INPUT type="text" class="mask" preset="currency"></TD><TD>$3,000.00</TD></TR>
<TR><TD>¹éºÐÀ²:</TD><TD><INPUT type="text" class="mask" preset="percent"></TD><TD>12%</TD></TR>
<TR><TD>¿ìÆí ¹øÈ£:</TD><TD><INPUT type="text" class="mask" preset="zip"></TD><TD>123-123</TD></TR>
<TR><TD>ÀüÈ­ ¹øÈ£:</TD><TD><INPUT type="text" class="mask" preset="area" size="6">-
<INPUT type="text" class="mask" preset="phone" size="12"></TD><TD>(031) 1234-1234</TD></TR>
</TABLE>
</FORM>
<P align=center style="background:ffa;padding:10;">
¿ìÃø ¿¹Á¦¿¡ »óÀÀÇÏ°Ô ÀÔ·ÂÇÏ°í ÃÊÁ¡À» À̵¿½ÃÄѺ¸¶ó.</P><BR>
<TABLE cellpadding=8 align=center style="border:solid 1 blue">
<TR><TD align=center><BUTTON onClick="self.close()">ÇöÀç º¸Á¶Ã¢ ´Ý±â</BUTTON></TD></TR>
</TABLE>
</TD></TR></TABLE>
</BODY>
</HTML>