Populate div from textarea field

Hi I want to create a div above every textarea field with its content so it will be printable. However for the first 2 fields the content is the same in the both divs. Can anyone see why?

// JavaScript Document
$(document).ready(function(){
$(‘textarea’).each(function(index) {
$(‘<div class=“print”></div>’).insertBefore(‘textarea’);
var textindex = $(‘textarea’).val();
$(“div.index”).text(textindex);
});
});

Steven

Try this

$(document).ready(function(){
    $('textarea').each(function(index) {
        $('<div class="print"></div>').insertBefore($(this));
        var textindex = $('textarea').val();
        $("div.index").text(textindex);
    });
});

Hi thanks but it just does the same thing.

Try this

$(document).ready(function(){
    $('textarea').each(function(i,v) {
        $('<div class="print"></div>').before($(v));
        var textindex = $(v).val();
        $(v).previous().text(textindex);
    });
});