const $ = jQuery = require('jquery'); // and here is your jQuery object of your html string const html = $("<div/>").append( html );