I have a string that contains html elements such as the following
var elements = "<div class='instance' id=''><h1></h1></div>";
how can work with it in order to be able to make like this
$('instance').prop('id',5);
$('instance h1').html('hello all');