redom / redom

Tiny (2 KB) turboboosted JavaScript library for creating user interfaces.

Home Page:https://redom.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

write HTML tags when creating an element

sptaule opened this issue · comments

Hello,
i would like to place HTML tags when creating an element but the html tags where rendered as text
const hello = el("div", "<span>Hello there</span>");
Am I missing something ? thanks !

Yes, text is rendered as text. You can use innerHTML param for example:

el('div', { innerHTML: '<span>Hello there</span>' });