JavaScript this.checked

前端 未结 4 1502
你的背包
你的背包 2021-01-05 09:45

In JavaScript, if we write the following for example:

var c = this.checked;

What is checked here? Is it just a state

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-05 10:30

    In jQuery checked is a selector:

    The :checked selector works for checkboxes and radio buttons.

    There are some ways to check if a checkbox is checked or not:

    For Example:

    $('#checkBox').attr('checked'); 
    
    or 
    
    $('#checkBox').is(':checked'); 
    

提交回复
热议问题