HTML input readonly 속성

HTML <input> readonly 속성
Input readonly 속성
input text 변경불가
input text 읽기전용

1 기초 예제 (속성)[ | ]

<!DOCTYPE html>
<meta charset='utf-8'>
<form action="form_action.asp">
변경불가 <input type="text" name="country" value="대한민국" readonly="readonly" /><br>
변경가능 <input type="text" name="city" value="서울" />
</form>

2 자바스크립트로 제어[ | ]

<!DOCTYPE html>
<meta charset='utf-8'>
<form name='myform' action="form_action.asp">
변경불가 <input type="text" name="country" value="대한민국" /><br>
변경가능 <input type="text" name="city" value="서울" />
</form>
<script>
myform.country.readOnly = true;
</script>

3 같이 보기[ | ]

4 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}