Say I have
$(\":input[type=text]:first\")
How do I get
Following on what @Blazemonger have answered, if you are going to send this html content to the server, it's worth to get rid of all unnecessary tags, white-spaces and line-breaks that don't add any value.
var quote = $(".invoice") //get hidden print-version DOM element
.clone()
.wrap('')
.parent()
.html()
.replace(/ /g, '') //get rid of indentation spaces
.replace(/(\r\n|\n|\r)/gm, "") //get rid of line breaks
.replace(//g, ""); //get rid of comment tags
My html had 50kb, after getting rid of this stuff, it got reduced to 4kb!