[jQuery] something wrong with $.each()

[jQuery] something wrong with $.each()


Sorry, cannot find solution, why this code don't modified variable
'doc'
    var doc = '<div><span>test</span></div>';
    $('span', doc).each(function() {
        $(this).text('new value');
    })
thank you.