Problems

Build the DOM String

MediumDOM & Events

Render a node spec to an HTML string. Spec: {"tag": string, "text": string?, "children": [...]}. Text renders inside the tag before children.

Input: one JSON spec. Output: the HTML string, no whitespace between tags.

Your program reads from stdin and prints to stdout.

Example 1

Input: {"tag":"div","text":"hi","children":[]}

Output: <div>hi</div>

Hints

JavaScriptDOMRendering
Build the DOM String | CodeForge AI