Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyHTMLElement {
- constructor(htmlElement) {
- this.htmlElement = htmlElement;
- this.changeColorOnClick();
- this.changeBorderOnInput();
- }
- changeColorOnClick() {
- this.htmlElement.onclick = () => {
- this.htmlElement.style.color = "blue";
- }
- }
- changeBorderOnInput {
- this.htmlElement.addEventListener("input", () => {
- this.htmlElement.style.border = "2px solid green";
- }
- }
Add Comment
Please, Sign In to add comment