반응형 jquery폼 요소3 [JQUERY] 입력후 Form 초기화하기 function ResetAll() { $('#폼ID명').each(function(){ this.reset(); }); } 2011. 9. 6. [JQUERY] checkbox 속성 1. 개수 구하기 $("input[name=chk]:checkbox:checked").length $("input[name='chk[]']:checked").length 2. 체크 확인 $("#check_all").is(':checked') 3. chk 개수만큼 돌면서 실행 $("input[name=chk]").each( function(){ // 명령어 } } 4. each 실행되면서 그 값이 참이면 실행하는 로직 var chk2 = $("input[name='chk2[]']"); var i = 0; $("input[name='chk1[]']").each( function(){ if(this.checked){ chk2[i].value = "Y"; }else{ chk2[i].value = "N"; } i.. 2011. 9. 6. [JQUERY] Input 모든 요소 가져오기 DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> $(document).ready(function() { var result = ""; // 폼 요소가 있는 만큼 반복하자. //alert($(':input').size()); $(':input').each(function(index) { result += "태그명 : " + this.tagName // $(this).get(0).tagName + ", type 속성명 : " + $(this).attr('type') + '\n'; }); alert(result); }); 드롭다운리스트 멀티라인텍.. 2011. 7. 12. 이전 1 다음 반응형