contentEditable="true" attribute on the node you want to be able to edit.
This is just a quick and dirty version but:
If you’re browsing in IE, the contents of this box will be editable, and if I’d had time to put bold and italic buttons on, you’d have been able to use the bold, and italic buttons to change the style of this text.
If you’re browsing in Mozilla, or another gecko-based browser, hit F7 to view the system caret, then click inside this box to edit the contents (in full WYSIWYG).
This is completely genius stuff