src/aria/utils/Html.js
function (domElement, dataset, remove) {
            var fullKey, stringUtil = ariaUtilsString;
            for (var dataKey in dataset) {
                if (dataset.hasOwnProperty(dataKey) && !ariaUtilsJson.isMetadata(dataKey)) {
                    if (this.datasetRegex.test(dataKey)) {
                        fullKey = "data-" + stringUtil.camelToDashed(dataKey);
                        if (remove) {
                            domElement.removeAttribute(fullKey);
                        } else {
                            domElement.setAttribute(fullKey, dataset[dataKey]);
                        }
                    } else {
                        this.$logError(this.INVALID_DATASET_KEY, dataKey);
                    }
                }
            }
        }
function (domElement, dataset, remove) {
            var fullKey, stringUtil = ariaUtilsString;
            for (var dataKey in dataset) {
                if (dataset.hasOwnProperty(dataKey) && !ariaUtilsJson.isMetadata(dataKey)) {
                    if (this.datasetRegex.test(dataKey)) {
                        fullKey = "data-" + stringUtil.camelToDashed(dataKey);
                        if (remove) {
                            domElement.removeAttribute(fullKey);
                        } else {
                            domElement.setAttribute(fullKey, dataset[dataKey]);
                        }
                    } else {
                        this.$logError(this.INVALID_DATASET_KEY, dataKey);
                    }
                }
            }
        }
function ( domElement , dataset , remove ) { var fullKey , stringUtil = ariaUtilsString ; for ( var dataKey in dataset ) { if ( dataset . hasOwnProperty ( dataKey ) && ! ariaUtilsJson . isMetadata ( dataKey ) ) { if ( this . datasetRegex . test ( dataKey ) ) { fullKey = "data-" + stringUtil . camelToDashed ( dataKey ) ; if ( remove ) { domElement . removeAttribute ( fullKey ) ; } else { domElement . setAttribute ( fullKey , dataset [ dataKey ] ) ; } } else { this . $logError ( this . INVALID_DATASET_KEY , dataKey ) ; } } } }
Set or remove "data-" attributes
@param {HTMLElement} domElement
@param {Object} dataset
@param {Boolean} remove if false or undefined, attributes will be set instead
Set or remove data - attributes