All web editors work pretty simple and relay on Browser functionality.
You can make any field of your HTML page editable by setting the attribute contenteditable="true" on the element and calling: $('#edit').designMode = "on"; after the page load
You can change the font of your selection with
document.execCommand("fontname", false, "Courier New");
the size with
document.execCommand("fontsize", false, "20");
the color with
document.execCommand("ForeColor", false, "green");
Bold, Italic with:
document.execCommand("bold", false);
document.execCommand("italic", false);
Here is a sample test page I created (which sadly only works in FF, because in the other browsers he looses the selection of your text when you click a button)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=utf-8>
<title>HTML5 Demo: ContentEditable</title>
<script src="jquery.js"></script>
</head>
<body onLoad="onload()">
<h2>Go ahead, edit away!</h2>
<div id="editarea"></div>
<!-- 'contenteditable="true"' need so the user can select the element and edit it's text-->
<section contenteditable="true">
<p>
Here's a typical paragraph element
</p>
<div contenteditable="true">
<p>
hallo welt
</p>
</div>
<ol>
<li>
and now a list
</li>
</ol>
</section>
</body>
<script>
function onload() {
// needed for the resize boxes in IE
document.designMode = "on"
$('#editarea').append($('<button>').html("fontname").click(function() {
document.execCommand("fontname", false, "Courier New");
}));
$('#editarea').append($('<button>').html("fontsize").click(function() {
document.execCommand("fontsize", false, "20");
}));
$('#editarea').append($('<button>').html("changeSize").click(function() {
document.execCommand("ForeColor", false, "green");
}));
$('#editarea').append($('<button>').html("bold").click(function() {
document.execCommand("bold", false);
}));
$('#editarea').append($('<button>').html("italic").click(function() {
document.execCommand("italic", false);
}));
}
</script>
</html>
PS in case you need more, you should look at Aloha editor