Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 516 Bytes

programatic-usage.md

File metadata and controls

22 lines (14 loc) · 516 Bytes

Programatic and Declaritive usage:

You can use <web-greeting> programatically:

const webGreeting = document.createElement("web-greeting")
webGreeting.name = "Justin"

document.body.append(webGreeting)

webGreeting.innerHTML //-> "<h1>Hello, Justin</h1>"

Or you can use it declaratively:

document.body.innerHTML = "<web-greeting></web-greeting>"

document.body.firstChild.name = "I do declare"

document.body.firstChild.innerHTML //-> "<h1>Hello, I do declare</h1>"