[°ÀÇ] <Ư°> ¼½Ä ¸¸µé±â 2
html/java script ¿¬½À »çÀÌÆ®(https://www.w3schools.com/js/tryit.asp?filename=tryjs_myfirst)
¡Û Á¶°Ç¹®
condition ? value1 : value2 | Á¶°Ç(condition)ÀÌ Âü(true)À̸é value1ÀÇ °ªÀ» ¹ÝȯÇÏ°í °ÅÁþ(false)À̸é value2ÀÇ °ªÀ» ¹ÝȯÇÕ´Ï´Ù.
¿¹¸¦ µé¾î (1<2 ? 0 : 1)À̶ó°í ÀÔ·ÂÇϸé Á¶°Ç '1<2'ÀÌ ÂüÀ̹ǷΠÁ¶°Ç½ÄÀÇ °ªÀº 0ÀÌ µË´Ï´Ù. ¹Ý´ë·Î (1>2 ? 0 : 1)À̶ó°í ÀÔ·ÂÇϸé Á¶°Ç '1>2'ÀÌ °ÅÁþÀ̹ǷΠÁ¶°Ç½ÄÀÇ °ªÀº 1ÀÌ µË´Ï´Ù.
day¿¡ Á¶°Ç½ÄÀ» °É¾î¼ ÆòÁ¤ ¾È³»¹® ¼½ÄÀ» ¸¸µé ¶§ Á¦1Â÷ ÆòÁ¤ÀÎÁö Á¦2Â÷ ÆòÁ¤ÀÎÁö ÀÚµ¿À¸·Î Ç¥±âµÇµµ·Ï ÇÒ ¼ö ÀÖ½À´Ï´Ù.
Á¦°¡ ¾²´Â ÆòÁ¤ ¾È³»¹® ¼½Ä ÄÚµå´Â ³»ÀÏ ¸¶Áö¸· Ư°¿¡¼ °ø°³ÇÏ°Ú½À´Ï´Ù.
¡Û html ÆÄÀÏ ºÏ¸¶Å©Çϱâ
Äڵ带 ¸Þ¸ðÀå¿¡¼ ÀÛ¼ºÇÑ ÈÄ html ÆÄÀÏ·Î ÀúÀåÇÏ°í ÆÄÀÏÀ» ¿¾î¼ ºÏ¸¶Å©(Áñ°Üã±â)¿¡ Ãß°¡ÇÏ¸é °£ÆíÇÏ°Ô ¿¶÷ÀÌ °¡´ÉÇÕ´Ï´Ù.
¡Û °ø¹® ¼½Ä
ÀÌ·¯ÇÑ Äڵ带 Á÷Á¢ È°¿ëÇÏ½Ç ºÐÀº ¸¹ÀÌ °è½ÃÁö ¾ÊÀ» °Í °°¾Æ ´õ ÀÌ»óÀÇ ÀÚ¼¼ÇÑ ¼³¸íÀº »ý·«ÇÏ°í Äڵ常 ¿Ã¸³´Ï´Ù. Áú¹®ÀÌ ÀÖÀ¸½Ã¸é ³²°ÜÁֽñ⠹ٶø´Ï´Ù. textarea Äڵ带 È°¿ëÇÏ¿© Á¦¸ñ°ú ³»¿ë ºÎºÐÀ¸·Î ³ª´² º¸¾Ò½À´Ï´Ù. °üºÎ¸í, °üÁ÷¸í, À̸§, Çà¼ö¹ý Ç¥±â´Â ÀÚ½ÅÀÇ °üÁ÷¿¡ ¸Ã°Ô ¼öÁ¤ÇÏ½Ã¸é µË´Ï´Ù.
<script> var today = new Date( ); var year = today.getFullYear( )-1391; var month = today.getMonth( )+1; var day = today.getDate( ); var a = "°üû"; var b = "°üÁ÷"; var c = "À̸§"; document.write("<textarea name=content cols=70 rows=3 onFocus=this.select()>"); document.write("[" , a , "/" , b , "] <°ø¹®> _¿¡ ´ëÇÏ¿©"); document.write("</textarea><BR><BR>"); document.write("<textarea name=content cols=70 rows=15 onFocus=this.select()>"); document.write("°ø¹®(ÍëÙþ) "); document.write("(°üû)¿¡¼ _¿¡ ´ëÇÏ¿© °ø¹®À» º¸³»´Ï, (½ÃÇà/ÇùÁ¶/Âü°í/ó°á)ÇϽñ⠹ٶø´Ï´Ù. "); document.write("...(³»¿ë) "); document.write("ÀÌ»ó °ø¹®ÀÔ´Ï´Ù. "); document.write("°³±¹" , year , "³â " , month , "¿ù " , day , "ÀÏ (Çà)" , a , b , " " , c , " "); document.write("* À§ °ø¹®À» ´ÙÀ½ °üû¿¡ º¸³À´Ï´Ù : "); document.write("</textarea>"); </script> |
¡Û °èº», °è¸ñ ¼½Ä
<script> var today = new Date( ); var year = today.getFullYear( )-1391; var month = today.getMonth( )+1; var day = today.getDate( ); var a = "°üû"; var b = "°üÁ÷"; var c = "À̸§"; document.write("<textarea name=content cols=70 rows=3 onFocus=this.select()>"); document.write("[" , a , "/" , b , "] <°èº»/¸ñ> _¿¡ ´ëÇÏ¿©"); document.write("</textarea><BR><BR>"); document.write("<textarea name=content cols=70 rows=15 onFocus=this.select()>"); document.write("(Çà)" , a , b , " ½Å " , c , ", _¿¡ ´ëÇÏ¿© °èº»/¸ñÀ» ¿Ã¸³´Ï´Ù. "); document.write("...ÇÏ´Â °ÍÀÌ ¾î¶°ÇÏ°Ú½À´Ï±î. "); document.write("»ï°¡ Çϱ³¸¦ ±â´Ù¸³´Ï´Ù. "); document.write("°³±¹" , year , "³â " , month , "¿ù " , day , "ÀÏ (Çà)" , a , b , " ½Å " , c); document.write("</textarea>"); </script> |
|