applan의 개발 이야기
[TIP] Jquery - 다양한 입력 태그 알아내기 본문
728x90
웹을 개발하다보면 TextArea 를 사용하는 일이 생기기 마련.
Jquery에서 Input, TextArea 값을 가져오는 방법을 적어둔다.
* TextArea는 항상 까먹어서 검색한다..
💡 알아둘 것
원하는 태크를 선택하는 다양한 방법들
😃 방법
1. Input
// SET
$("원하는 InputBox").val("원하는 값");
// GET
$("원하는 InputBox").val();
2. radio
// SET
$("원하는 radio").prop('checked',true); // 선택
$("원하는 radio").prop('checked',false); // 취소
// GET
$("원하는 radio").val();
3. checkBox
// SET
$("원하는 checkBox").prop('checked',true); // 선택
$("원하는 checkBox").prop('checked',false); // 취소
// GET
$("원하는 checkBox").val();
4. textArea
// SET
$("원하는 textArea").val("원하는 값");
// GET
$("원하는 textArea").val();
728x90
'개발 > Dev.' 카테고리의 다른 글
[TIP] Javascript - Input Group (0) | 2023.01.10 |
---|---|
[오류해결] Invalid media type "x-www-form-urlencoded; charset=UTF-8": does not contain '/' (0) | 2022.09.22 |
[오류해결] An error occurred on the server. (1) | 2022.09.13 |
[오류해결] getter, setter 어노테이션 인식 문제 (0) | 2022.09.04 |
[오류해결] Android BitmapFactory 오류 (0) | 2022.08.23 |