Skip to content

Instantly share code, notes, and snippets.

@bcls
bcls / getCheckedBoxValues.js
Created December 23, 2017 18:58
Get Array of Checked checkbox Values #javascript
// collection of checkboxes obtained by getElementsByName()
/**
* get array of values for checked boxes in a collection
* @param {htmlElementCollection} checkBoxCollection collection of checkbox elements
* @return {Array} array of the values of the checked boxes
*/
function getCheckedBoxValues(checkBoxCollection) {
var checkedValues = [],
i,