JSFiddle - React, Tailwind, and code Playground

JavaScript

var div = $("<div />")
$(div).attr("data-foo", "bar")
console.log($(div)[0].outerHTML)