How can I replace a ClassName in the code below, with a variable.
I have:
(function (root, factory) {
factory((root.ClassName= {}));
dragged =[].slice.call(_document.getElementsByClassName('ClassName'));
});
How can I replace where i have the ClassNames with a variable like this:
(function (root, factory) {
var x = ClassName
factory((root.ClassName= {}));
dragged =[].slice.call(_document.getElementsByClassName('ClassName'));
});
Note that it is only a part of the code I have, I do not need to change the code, I just need to call a variable where those classnames are appearing.
Are you perhaps looking for something like this?
function (root, factory) {
var x = "ClassName";
factory((root[x]= {}));
dragged = [].slice.call(_document.getElementsByClassName(x));
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With