Say I have
$(\":input[type=text]:first\")
How do I get
An old trick:
var selector = ":input[type=text]:first"; var str = $(selector).clone().wrap('').parent().html();
Update You don't need to worry about calling .parent() since you're working with an orphaned clone of the original selector.
.parent()