ff
by Artem
HTML
<button class="RP-send-button"></button>
JavaScript
'use strict';
// configuration selector
// data-test-selector
// data-aqa-selector
const TEST_SELECTOR = 'test-selector';
const targetSelector = '.RP-send-button';
const testSelector = 'send_button';
// options.selector = 'test-selector'
function SelectorFactory(options) {
this.selector = options.selector;
}
SelectorFactory.prototype.apply(targetSelector, testSelector) {
const element = document.querySelector(targetSelector);
const attribute = element.getAttributeNode(this.selector);
attr.value = testSelector;
};
const selectorFactory = new SelectorFactory({
selector: 'test-selector'
});