dz¼±µµ¿ò¸»... |
|
ÄÄÇ»ÅÍ¿Í °ü·ÃÀÖ´Â ¸ðµç ÆÁÀ» °øÀ¯ÇսôÙ.
<label for="movie">´ç½ÅÀÌ ÁÁ¾ÆÇÏ´Â ¾ÛÀº ¹«¾ùÀΰ¡¿ä?</label> <input type="text" list="movie-options" /> <datalist id="movie-options"> <option value="È£ °¡°èºÎ" /> <option value="È£ °æÁ¶°ü¸®" /> <option value="È£ ¾÷¹«°ü¸®" /> <option value="È£ Àç°í°ü¸®" /> <option value="È£ ÁÖÂ÷°ü¸®" /> <option value="È£ ÇÖµô" /> <option value="È£ World News" /> </datalist>
datalist¿¡¼ º¸¿©Áö´Â °ª ÀÌ ¾Æ´Ñ ¼û°ÜÁø °ªÀ» ¾Ë¾Æ³»´Â ¹æ¹ý
ÀÚ¹Ù½ºÅ©¸³Æ® ÇÔ¼ö function datalistChange() { var appName = document.getElementById("app").value; var appValue = document.querySelector(#apps option[value='" + appName + "']).dataset.value; console.log(appValue); } html ÅÂ±× <input type="text" list="apps" id="app" /> <datalist id="apps"> <option data-value="1" value="È£ °¡°èºÎ" /> <option data-value="2" value="È£ °æÁ¶°ü¸®" /> <option data-value="3" value="È£ ¾÷¹«°ü¸®" /> <option data-value="4" value="È£ Àç°í°ü¸®" /> <option data-value="5" value="È£ ÁÖÂ÷°ü¸®" /> <option data-value="6" value="È£ ÇÖµô" /> <option data-value="7" value="È£ World News" /> </datalist>
|
ºÎ»ê±¤¿ª½Ã ºÎ»êÁø±¸ ´ç°¨ 4µ¿ 659-1. ÁÁÀº ¼ÒÇÁÆ®¿þ¾î °³¹ß ¿îµ¿º»ºÎ. ´ëÇ¥ ¾ÈµæÈ£ / sinmungo @ hotmail . com Copyright(c) È£°¡°èºÎ. All Rights Reserved. Since 2003. 04 |