테스트 사이트 - 개발 중인 베타 버전입니다

select box 컨트롤

· 9년 전 · 340

// [ select box 컨트롤 ] --------------------------------------------------------------/// 

// 셀렉트박스 초기화        
//SelectBox 애완동물중 고양이 값 선택하기.
$("#ANI").val('2');
$("#ANI>option[value='2']").attr("selected", true);
//또는 옵션그룹이 있는Select Box 인경우
$("#ANI> optgroup >option[value='2']").attr("selected", true);
 
//선택된 값 읽어오기
$("#ANI option:selected").val();
$("select[name=ANI]").val();
 
//선택된 값 삭제
$('#ANI option:selected').remove();
 
//SelectBox 애완동물중 고양이 삭제
$("#ANI option[value='2']").remove();    
  
jQuery("#ElementID").is(":checked")
 
if(jQuery("#ElementID").is(":checked"))  
{
     체크된 상태
}
else
{
    체크가 해제된 상태
}
 
select box의 내용 가져오기
$("#select_box > option:selected").val();
select box의 값 설정
 $("#select_box > option[value=지정값]").attr("selected", "true");

댓글 작성

댓글을 작성하시려면 로그인이 필요합니다.

로그인하기

게시글 목록

번호 제목
12333
12332
12331
12329
12328
12327
12326
12325
12324
12323
12322
12321
12320
12319
12318
12317
12316
12315
12314
12313
12312
12311
12310
12309
12308