¾È±Ô °øºÎ¹æ

Javascript & JQuery & CSS > example - readOnly 󸮹æ¹ý

µî·ÏÀÏ : 2017-07-04 18:39 Á¶È¸¼ö : 53,806

Text ű׿¡ ReadOnly ¼Ó¼ºÀ» ½ºÅ©¸³Æ®¸¦ ÀÌ¿ëÇØ ¼öÁ¤ÇØ¾ß ÇÒ °æ¿ì°¡ Á¾Á¾ »ý±ä´Ù. ÀÌ·±°æ¿ì, ¾Æ·¡Ã³·³

getElementById ÇÔ¼ö¸¦ ÀÌ¿ëÇؼ­ ó¸®µÉ ¼ö ÀÖ´Ù.

document.getElementById("aaa").readOnly = true;
document.getElementById("aaa").focus();


Jquery¸¦ ÀÌ¿ëÇÑ readonly ¼Ó¼º º¯°æ ¹æ¹ýÀº ¾Æ·¡¿Í °°½À´Ï´Ù.
 

	// readonly ¼Ó¼º ÇØÁ¦Çϱâ
	$("input[name=id]").attr("readonly", false);
	$("input[name=id]").prop("readonly",false); 

	// readonly ¼Ó¼º Àû¿ëÇϱâ
	$("input[name=id]").attr("readonly", true);
	$("input[name=id]").prop("readonly",true); 
¡Ø Ȥ½Ã µµ¿òÀÌ µÇ¼Ì´Ù¸é ´ñ±Û¿¡ ÇѸ¶µð ³²°ÜÁÖ¼¼¿ä!
ÀÛ¼ºÀÚ   ºñ¹Ð¹øÈ£
ÀÚµ¿±Û ¹æÁö     (ÀÚµ¿±Û ¹æÁö ±â´ÉÀÔ´Ï´Ù.)
³»¿ë   ´ñ±Û´Þ±â 
À̸ÞÀÏ ¹®ÀÇ : cak0280@nate.com  
Copyright 2000 By ENTERSOFT.KR All Rights Reserved.