I was wondering if there was any method to get a html element / node without its children as a string.
This question might seem like a duplicate of this question: jQuery, get html of a whole element.
But i only want the html element itself as a string, without its children.
texts.push({title:'[#target, outerHTML]', value: $input[0].outerHTML});
texts.push({title:'[#target, $.html()]', value: $input.html()});
texts.push({title:'[#bigger_Target, outerHTML]', value: $('#bigger_Target')[0].outerHTML});
texts.push({title:'[#bigger_Target, $.html()]', value: $('#bigger_Target').html()});
texts.push({title:'[#target, DESIRED]', value: '<input class="test" data-type="text only" type="button" value="Test />"'});
texts.push({title:'[#bigger_Target, DESIRED]', value: '<div id="bigger_Target" />'});
FIDDLE:
http://jsfiddle.net/ttoom9hc/12/
FIDDLE FROM OTHER POST:
http://jsfiddle.net/u6avkvz0/