Html & Script

(Jquery) radio checked 라디오 제어

컨텐츠 정보

본문

출처 : http://blog.naver.com/qfwh/220391546930

 

 

 1. 라디오 박스 원하는 값 체크하고 싶을때

  $('input[name="item"]:radio[value="3"]').prop('checked',true);

 

  2. 체크되어있는 라디오박스의 값을 알고 싶을때

  $('input[name="item"]:checked').val();

 

  3. 체크되어 있는 모든 체크박스를 해제하고 싶을때

  $('input[name="item"]').removeAttr('checekd');

  

  4. 라디오박스가 하나라도 체크되어 있는지 확인 할때

​  $('input[name="searchitem"]:checked').length;  

 

 

 

관련자료

댓글 0
등록된 댓글이 없습니다.
Today's proverb
전력을 다하여 자신에게 충실하고 올바른 길로 나가라. 참으로 내 생각을 채울 수 있는 것은 나 자신 뿐이다. 나를 변화시킬 수 있는 건 오로지 나뿐이다. (우렐리우스)