Check if a checkbox is checked in a group of checkboxes in clientside

前端 未结 3 1887
忘了有多久
忘了有多久 2020-12-22 01:32

Please note that the scenario is ASP.NET Webforms + Master - Content page which mess up the ids.
I have, say, three checkboxes



        
3条回答
  •  鱼传尺愫
    2020-12-22 02:33

    There is a :checked ( http://api.jquery.com/checked-selector/ ) selector you can use :

    
    

    You may want to add (or use) an id on the container of these checkbox, to optimize selector speed.

    As for asp.net messing up client ids on controls, you can use

    $('<% =MyControl.ClientID %>')
    

提交回复
热议问题