Posted By

crutzdesigns on 02/04/11


Tagged

jqueryhtmlstringconvert


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

virendrakryadav


jQuery().toHTMLString


 / Published in: jQuery
 

Gets the currently selected element as a string.

Usage: $("div#item1").toHTMLString();

  1. jQuery.fn.extend({
  2. toHTMLString: function() {
  3. return $('<div>').append(this.clone()).remove().html();
  4. }});

Report this snippet  

You need to login to post a comment.