JSFiddle - React, Tailwind, and code Playground

JavaScript

var data = "<h1>My heading</h1><p>This is a test</p><p>This <span>is another</span> test.</p>";

var $data = $(data),
    $title = $data.filter("h1"),
    title = $title.text();

$data = $data.not($title);

alert("Title is: " + title +
      "\n\nAnd the rest is: " +
     $("<div></div>").append($data).html());