Created
October 22, 2019 15:16
-
-
Save JeremyLikness/d8b180d1bb250fddd13f27644f601150 to your computer and use it in GitHub Desktop.
Vanilla.js anchor tag
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 characters
| class AnchorWrapper extends Wrapper { | |
| constructor(href, text, target = "_blank") { | |
| super("a", text); | |
| this.element.href = href; | |
| this.element.target = target; | |
| } | |
| static generate(href, text, target = "_blank") { | |
| return new AnchorWrapper(href, text, target); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment