Factsheet
Videos
There are many WYSIWYG Editors out there, but some are very old and the dev experience is quite bad. Some are headless with many plugins and need a lot of time to tune them to your liking.
I am looking for a very simple WYSIWYG Editor, if possible just an import and then specify an id. What are your goto WYSIWYG Editors?
Edit: Sorry I was not clear enough. I am not looking for a Website Builder, I am looking for an Editor where a User can write something like a Blog Post.
I have found several. Like ProseMirror, Slate, DraftJs, Quill, EditorJS, TinyMCE, TipTap etc.
Javascript WYSIWYG editors do not use a textarea (at least not externally, it is likely that behind the scenes there is a textarea that is populated with the code that makes up the WYSIWYG content so that it can be posted in a form).
Rather, there are two properties that are used to make an editable area in a webpage: designMode, which applies to a whole document, or contentEditable, which applies to a specific element. Both properties were originally Microsoft innovations, but have been adopted by all major browsers (contentEditable is now part of HTML5).
Once a document (in terms of rich text editors this generally means embedding an iframe with designMode set into your page) or element is made editable, formatting is done by using the execCommand method (for which there are a number of different modes -- bold, italics, etc. -- which are not necessarily the same across all browsers. See this table for more info).
In order to pass content from the editable element to the server, generally the innerHTML of the editable element, is loaded into a textarea, which is posted. The makeup of the HTML generated depends on the browser.
Resources:
- http://blog.whatwg.org/the-road-to-html-5-contenteditable
- http://www.mozilla.org/editor/ie2midas.html
I have a good idea take this code to make a cool WYSIWYG editor-
To make a nice editor I have made a code with JavaScript that will open a new window containing the result-
Let's start with the Body-
<body>
<textarea style="height:400px;width:750px;overflow:auto;"onblur="x=this.value"></textarea>
<br />
<button onclick="ShowResult()">see result!</button>
</body>
Now we continue with the JavaScript-
function ShowResult()
{
my_window = window.open("about:blank", "mywindow1");
//By the above line code we have opened a new window
my_window.document.write(x);
//Here we have added the value of the textarea to the new window
}
Let's see the code on-whole:-
<html>
<script type="text/javascript">
function ShowResult()
{
my_window = window.open("about:blank", "mywindow1");
my_window.document.write(x);
}
</script>
<body>
<textarea style="height:400px;width:750px;overflow:auto;" onblur="x=this.value">
</textarea><br />
<button onclick="ShowResult()">see result!</button>
</body>
</html>
If i can help you in any way i am very happy doing that.
Thank you for asking this question and for increasing my curiosity towards JavaScript.