¾È³çÇϼ¼¿ä.
jQuery °ÀÇ ±³¾È¿¡´Â
¾Æ·¡¿Í °°ÀÌ ¼³¸íÀÌ µÇ¾î ÀÖ½À´Ï´Ù.
$(this) : À̺¥Æ® Çڵ鷯 ÄÁÅؽºÆ®
this
À̺¥Æ® Çڵ鷯¿¡¼ÀÇ this´Â DOMÀ» °¡¸®Å´
$(this)
ÇöÀç À̺¥Æ®°¡ Àû¿ëµÈ °³Ã¼(DOM)¸¦ jQuery °³Ã¼·Î ¹Ýȯ(º¯È¯)
jQuery(this)¿Í µ¿ÀÏÇÑ ±â´ÉÀÓ
$(this)¿¡ Á¡À» ÂïÀ¸¸é
jQuery ÁÖ¿ä ¸Þ¼µå(±â´É) »ç¿ë °¡´É
¿¹: $(this).addClass();
this.id
DOM °³Ã¼ Áß Å¬¸¯µÈ ¿ä¼Ò¸¦ ¾Ë°íÀÚÇÒ ¶§¿¡´Â id ¼Ó¼º »ç¿ë
Áï, ƯÁ¤ À̺¥Æ® 󸮱⳻¿¡¼ $(this) Äڵ带 ÅëÇؼ ÇØ´ç °³Ã¼¸¦
jQuery °³Ã¼·Î º¯È¯ÇÏ¿© jQueryÀÇ ÁÖ¿ä ±â´ÉµéÀ» »ç¿ëÇÏ°Ô ÇÏ°íÀÚÇÒ ¶§
»ç¿ëµË´Ï´Ù.
±×³É this´Â JavaScript¿¡¼ÀÇ this ±× ÀÚüÀÔ´Ï´Ù.
Âü°íÇØÁÖ¼¼¿ä...
¹ÚÁØÈ£ ´ÔÀÌ ¾²½Å ¿ø¹® ±ÛÀÔ´Ï´Ù.
¹Ú¿ëÁØ°»ç´ÔÀÇ jquery°ÀÇ µè°í ÀÖ½À´Ï´Ù.
jquery¿¡¼ $(this)ÇÏ°í ±×³É this°¡ Çò°¥¸³´Ï´Ù.
¾î¶³ ¶§ $(this)¸¦ ÇÏ°í ¾î¶³ ¶§ ±×³É this¸¦ ¾²´ÂÁö¿ä
|