    $(document).ready(function() {
    $('#text').one('focus',function() {
        $('#text').parent().after('<div><label class="preview">Comment Preview:</label></div><div id="comment-preview"></div>');
    });
    var $comment = '';
    $('#text').keyup(function() {
        $comment = $(this).val();
        $comment = $comment.replace(/<\/?[^>]+>/g,"").replace(/\n/g, "<br />").replace(/\n\n+/g, '<br /><br />'); // this strips tags and then replaces new lines with breaks
        $('#comment-preview').html( $comment );
    });
});