How to retrieve checkboxes values in jQuery

前端 未结 15 2321
时光说笑
时光说笑 2020-11-22 10:11

How to use jQuery to get the checked checkboxes values, and put it into a textarea immediately?

Just like this code:


  
  &l         


        
15条回答
  •  情书的邮戳
    2020-11-22 11:10

    I have had a similar problem and this is how i solved it using the examples above:

     $(".ms-drop").click(function () {
            $(function showSelectedValues() {
                alert($(".ms-drop input[type=checkbox]:checked").map(
                   function () { return this.value; }).get().join(","));
            });
        });
    

提交回复
热议问题