Skip to content

Instantly share code, notes, and snippets.

@JeremyLikness
Created October 22, 2019 15:16
Show Gist options
  • Select an option

  • Save JeremyLikness/d8b180d1bb250fddd13f27644f601150 to your computer and use it in GitHub Desktop.

Select an option

Save JeremyLikness/d8b180d1bb250fddd13f27644f601150 to your computer and use it in GitHub Desktop.
Vanilla.js anchor tag
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