Get Raw HTML of Node in JQuery

Posted by viatropos on Stack Overflow See other posts from Stack Overflow or by viatropos
Published on 2010-05-06T08:35:56Z Indexed on 2010/05/06 8:48 UTC
Read the original article Hit count: 380

Filed under:
|
|

I have used $("#parent").html() to get the inner html of #parent, but how do I get the html of the parent itself?

The use case is, I grab an input node like this:

var field = $('input');

I would like to be able to get the raw html of that node (<input type='text'>) with something like field.html(), but that returns empty. Is this possible?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about html