Q:

What does jQuery html( ) returns? 

i have seen the code below which is interesting to me:
var target = $('#target');
target.html(target.html().replace(/h2/g,'h3'));

i'm wondering html( ) return the html content of that element, why it can use .replace( ) method of javascript String? 

A:

As explained quite clearly in the documentation, called with no arguments it returns the html content as a string... (What else would html be?) 
As an aside, rather than nesting a call to .html() inside another, to do a replacement on the same element(s) you can do this:
$("#target").html(function(i, h) { return h.replace(/h2/g, "h3"); });

