OnClick vs OnClientClick for an asp:CheckBox?

后端 未结 8 1401
我在风中等你
我在风中等你 2020-12-07 16:33

Does anyone know why a client-side javascript handler for asp:CheckBox needs to be an OnClick=\"\" attribute rather than an OnClientClick=\"\" attribute, as for asp:Button?<

8条回答
  •  萌比男神i
    2020-12-07 16:59

    You can do the tag like this:

    
    

    The .checked property in the called JavaScript will be correct...the current state of the checkbox:

      function checkchanged(obj) {
          alert(obj.checked)
      }
    

提交回复
热议问题