Skip to content

Instantly share code, notes, and snippets.

View proddi's full-sized avatar
💭
coding at the couch 👍

proddi

💭
coding at the couch 👍
View GitHub Profile
@proddi
proddi / index.html
Last active November 19, 2023 16:26
A html template engine in vanilla javascript.
<body>
<p template="hello">
Hello <i>{name}</i>
</p>
<script>
var HelloTemplate = new Template(document.querySelector("[template=hello]"));
var clone = HelloTemplate.clone({ name: "John Doe" }).append();
clone.update({ name: "John Update" });
</script>
</body>