src/salvation.js
function (elements, attribute, value) {
            var foundElements = [], value = value || null;
            for (i = 0; i < elements.length; i++) {
                // If the value parameter is set, return only the
                // elements that has the given attribute value.
                if (value !== null) {
                    if (elements[i].getAttribute(attribute) === value)
                        foundElements.push(elements[i]);
                } else {
                    if (elements[i].getAttribute(attribute) !== null)
                        foundElements.push(elements[i]);
                }
            }

            return foundElements;
        }
function (elements, attribute, value) {
            var foundElements = [], value = value || null;
            for (i = 0; i < elements.length; i++) {
                // If the value parameter is set, return only the
                // elements that has the given attribute value.
                if (value !== null) {
                    if (elements[i].getAttribute(attribute) === value)
                        foundElements.push(elements[i]);
                } else {
                    if (elements[i].getAttribute(attribute) !== null)
                        foundElements.push(elements[i]);
                }
            }

            return foundElements;
        }
function ( elements , attribute , value ) { var foundElements = [ ] , value = value || null ; for ( i = 0 ; i < elements . length ; i ++ ) { // If the value parameter is set, return only the // elements that has the given attribute value. if ( value !== null ) { if ( elements [ i ] . getAttribute ( attribute ) === value ) foundElements . push ( elements [ i ] ) ; } else { if ( elements [ i ] . getAttribute ( attribute ) !== null ) foundElements . push ( elements [ i ] ) ; } } return foundElements ; }
Find elements by attribute name, with option
to also go by the attribute value.

@param       elements    Array of elements to search
@param       string      Value to find
@returns     array       List of elements found
Find elements by attribute name with option to also go by the attribute value .