웹 & 프레임워크

jquery 체크박스 설정과 이용

늘근이 2014. 5. 14. 10:40

             function button(flag){

                                        //input타입 버튼이거나, button속성이거나  찾아버리기

                                        if(flag) {

                                        $(":button").addClass("highlight");

                                        }else{

                                        $(":button").removeClass("highlight");

 

                                        }

             }

            

             //요건 on/off 자동으로 해주는거임

             function toggleButton(){

             $(":button").toggleClass("highlight");

             }

            

             function checkbox(){

                           //체크된 체크박스줌.

             console.log($(":checkbox:checked").val());

                          

                           //몇개 체크됐는지도 알려줌

             console.log($(":checkbox:checked").length);

 

             }