Use WordPress’s Ajax API. like this:
$.ajax({
data: {
action: 'save_post_frontend',
content: // get your text
},
method: 'POST',
url: ajaxurl,
success: // on success
});
Now save the data in wp_ajax_save_post_frontend hook.
See documentation for more info.