2014. 12. 30. 09:41 javascript
jquery input type 값 추출 또는 선택 총 정리
제일 귀찮고 어려운 작업이다.
1 text
2 radio
1) 값 추출
2) 값 설정
$( "#radio" ).buttonset('refresh');
$("input[name='correctAnswer']").checkboxradio( "refresh" );
var presetValue = "black";
$("input[name=correctAnswer]").filter("[value=" + presetValue + "]").prop("checked",true);
$("input[name=correctAnswer]").button( "refresh" );//JQuery UI only
3 checkbox
1) 값 추출
- if($("input:checkbox[id='menu_grant_all']").is(":checked") == true ) {
console.log("checked");
$("input:checkbox[name=menu_all_yn]").each(function() {
this.checked = true;
})
2) 값 설정
'javascript' 카테고리의 다른 글
네트웍 시각화 관련 (0) | 2015.07.08 |
---|---|
ajax template for json (0) | 2015.01.29 |
자바 스크립트 form 데이터 암호화 방법 (0) | 2014.11.27 |
jQuery.Deferred (0) | 2014.11.27 |
자신의 PC에 설치되어 있는 JRE 버전 체크 (0) | 2014.08.08 |