How set item checkbox when i click on element span which have this checkbox?

前端 未结 3 1300
抹茶落季
抹茶落季 2021-01-21 05:11

Me need set item checkbox when i click on element span which have this checkbox.

Code:



        
3条回答
  •  伪装坚强ぢ
    2021-01-21 05:36

    change your s to with a for= attribute matching the ID of your input, like so:

    
    
    

    http://jsfiddle.net/2GbPS/

    Actually, since you have your checkbox inside the span, this will work:

    
    

    (fiddle updated)

    Works with radios too!

    
    

提交回复
热议问题