Created
November 27, 2018 15:31
-
-
Save DigitalKrony/e204e159e95330ec235ce5e83e8c11f8 to your computer and use it in GitHub Desktop.
Revisions
-
DigitalKrony created this gist
Nov 27, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ Object.prototype.removeClass = function (string) { var classList = this.className.split(' '); var classesToRemove = string.split(' '); for (var toRemove of classesToRemove) { var index = classList.indexOf(toRemove); if(index !== -1) { classList.splice(index, 1); } } this.classList = classList.join(' '); };