Created
June 23, 2022 23:51
-
-
Save Nick-Gabe/4494394353bf8a6b2a8d5803c669694c to your computer and use it in GitHub Desktop.
Adds styles to a Html Element based on a CSS Object.
This file contains 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 characters
HTMLElement.prototype.setStyle = function (newStyles) { | |
for (let style in newStyles) { | |
this.style[style] = newStyles[style]; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment