JSFiddle - React, Tailwind, and code Playground

HTML

<div id="log"></div>

JavaScript

$.each(["is interpreted as HTML", "isn't"], function( _, str ) {
    var input = "<div> " + str;
    $("#log").append(
        $("<code>").text( '$("' + input + '").length' ),
        ": " + $( input ).length,
        "<br />"
    );
});