function collectIDs(name) {
    var elements = document.querySelectorAll('[name="' + name + '"]:checked');
    var ids = [];
    for (var i = 0; i < elements.length; i++) ids.push(elements[i].getAttribute('id'));
    return ids;
  }
// finding matches. It takes the ID attributes for the matches and returns them as an Array.
finding matches. It takes the ID attributes for the matches and returns them as an Array.
finding matches . It takes the ID attributes for the matches and returns them as an Array .
function collectIDs(name) {
    var elements = document.querySelectorAll('[name="' + name + '"]:checked');
    var ids = [];
    for (var i = 0; i < elements.length; i++) ids.push(elements[i].getAttribute('id'));
    return ids;
  }
function collectIDs ( name ) { var elements = document . querySelectorAll ( '[name="' + name + '"]:checked' ) ; var ids = [ ] ; for ( var i = 0 ; i < elements . length ; i ++ ) ids . push ( elements [ i ] . getAttribute ( 'id' ) ) ; return ids ; }
finding matches.
finding matches .