How to retrieve checkboxes values in jQuery

前端 未结 15 2030
时光说笑
时光说笑 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 10:53

    If you want to insert the value of any checkbox immediately as it is being checked then this should work for you:

    $(":checkbox").click(function(){
      $("#id").text(this.value)
    })
    

提交回复
热议问题