jQuery get DOM element as string
var selector = ":input[type=text]:first";var str = $(selector).clone().wrap('<div/>').parent().html();
Update You don't need to worry about calling .parent()
since you're working with an orphaned clone of the original selector.
Use jQuery.html() by appending to a created element.
$('<div/>').append($(":input[type=text]:first").clone()).html()
Here is a fiddle providing an example: http://jsfiddle.net/Zwbmx/1/