jQuery.fn.outerHTML = function() { //this function are taken from http://brandonaaron.net/jquery/snippets/outerHTML/example.html return $('<div>').append( this.eq(0).clone() ).html(); }; jQuery('#link').click(function(){alert($(this).outerHTML());return false;})
On Nov 11, 12:44 am, cc96ai <[EMAIL PROTECTED]> wrote: > <a id="link" href="/test.html" target="_new">my link</a> > > after remove the target attribute > $("#link").removeAttr("target"); > > I want to get the string is > <a id="link" href="/test.html" >my link</a> > > but how could I ? > I don't think jquery have toString() function, > any idea ?