JSFiddle - React, Tailwind, and code Playground

HTML

<!DOCTYPE html>

JavaScript

var div = document.createElement("div");
div.innerHTML = "<foo>This is a <bar /> test. <br> Another test.</foo>";
alert(div.innerHTML);