Home >Web Front-end >JS Tutorial >jQuery method to traverse all CheckBoxes on the page to see if they are selected_jquery

jQuery method to traverse all CheckBoxes on the page to see if they are selected_jquery

WBOY
WBOYOriginal
2016-05-16 16:04:131569browse

The example in this article describes how jQuery traverses all CheckBoxes on the page to see if they are selected. Share it with everyone for your reference. The details are as follows:

$('#tbl').find(':checkbox').each(function(){
  if ($(this).is(":checked")) {
    //操作
  }
});

I hope this article will be helpful to everyone’s jQuery programming.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn