{"id":19177,"date":"2017-11-29T16:15:27","date_gmt":"2017-11-29T14:15:27","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=19177"},"modified":"2017-12-19T12:55:21","modified_gmt":"2017-12-19T10:55:21","slug":"html5-text-editor-example","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/","title":{"rendered":"HTML5 Text Editor Example"},"content":{"rendered":"<p>In this post, we will take a look at the implementation of an In-browser text editor. The editor will provide basic editing functionality like making the text bold, italic, underline, strikeout and indentation, alignment of blocks of text. A text editor provides useful functionality that can be leveraged in blog comments section apart from other kinds of websites.<\/p>\n<h2>1. Introduction<\/h2>\n<p>We will be using the <code>contenteditable<\/code> attribute along with <code>execCommand<\/code> method of the <code>document<\/code> object. So, let&#8217;s get started.<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n[ulp id=&#8217;tgm4cmEWcKUikZNn&#8217;]<\/p>\n<h2>2. Tools &amp; Technologies<\/h2>\n<ol>\n<li>HTML5<\/li>\n<li>CSS3<\/li>\n<li>JavaScript<\/li>\n<li><a href=\"https:\/\/nodejs.org\/en\/download\/\" target=\"_blank\" rel=\"noopener\">Nodejs v6.3.0<\/a><\/li>\n<li><a href=\"https:\/\/www.npmjs.com\/package\/express\" target=\"_blank\" rel=\"noopener\">Express<\/a><\/li>\n<li><a href=\"https:\/\/code.visualstudio.com\/download\" target=\"_blank\" rel=\"noopener\">Visual Studio Code IDE<\/a><\/li>\n<\/ol>\n<p>NodeJS, in essence, is JavaScript on the server-side. The Express module is used to create a barebones server to serve files and resources to the browser. I have used the Visual Studio Code IDE since I am the most familiar with it although you could others as per preference.<\/p>\n<h2>3. Project Layout<\/h2>\n<p>The layout of our project is as shown in the screen grab below:<\/p>\n<figure id=\"attachment_19337\" aria-describedby=\"caption-attachment-19337\" style=\"width: 353px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/11\/ProjectLayoutTextEditorProject.jpg\"><img decoding=\"async\" class=\"size-full wp-image-19337\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/11\/ProjectLayoutTextEditorProject.jpg\" alt=\"\" width=\"353\" height=\"350\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/11\/ProjectLayoutTextEditorProject.jpg 353w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/11\/ProjectLayoutTextEditorProject-150x150.jpg 150w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/11\/ProjectLayoutTextEditorProject-300x297.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/11\/ProjectLayoutTextEditorProject-70x70.jpg 70w\" sizes=\"(max-width: 353px) 100vw, 353px\" \/><\/a><figcaption id=\"caption-attachment-19337\" class=\"wp-caption-text\">Project Layout<\/figcaption><\/figure>\n<p><strong><em>CSS Folder<\/em><\/strong><br \/>\nThis folder hosts our CSS files, namely, <code>html5.accordion.example.css<\/code>. We stylize our UI with classes in this file.<br \/>\n<strong><em>JS Folder<\/em><\/strong><br \/>\nOur client side JavaScript files reside here. These are referenced in our HTML page(s).<br \/>\n<strong><em>index.js<\/em><\/strong><br \/>\nI have used NodeJS and Express module to spin up a barebones Web Server for this example.<br \/>\n<strong><em>index.html<\/em><\/strong><br \/>\nThis is our Markup file, it hosts the UI of this example.<\/p>\n<h2>4. Implementation<\/h2>\n<p>To implement our editor we will proceed as in the steps listed below:<\/p>\n<h3>4.1. HTML Markup<\/h3>\n<p>We add a series of buttons, sort of like a toolbar, with each being responsible for one feature. Like a button with text &#8220;bold&#8221; to make any text selection bold and so on and so forth. The HTML markup for the same looks like below:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>index.html<\/em><\/span><\/p>\n<pre class=\"brush: html;\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n    &lt;head&gt;\r\n        &lt;meta charset=\"utf-8\"&gt;\r\n        &lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"&gt;\r\n        &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"&gt;\r\n&lt;!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags --&gt;\r\n        &lt;title&gt;WCG -- HTML5 Text Editor Example&lt;\/title&gt;\r\n\r\n        &lt;link rel=\"stylesheet\" href=\"css\/html5.text.editor.css\" \/&gt;\r\n\r\n&lt;!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --&gt;\r\n&lt;!-- WARNING: Respond.js doesn't work if you view the page via file:\/\/ --&gt;\r\n&lt;!--[if lt IE 9]&gt;\r\n&lt;script src=\"https:\/\/oss.maxcdn.com\/html5shiv\/3.7.3\/html5shiv.min.js\"&gt;&lt;\/script&gt;\r\n&lt;script src=\"https:\/\/oss.maxcdn.com\/respond\/1.4.2\/respond.min.js\"&gt;&lt;\/script&gt;\r\n&lt;![endif]--&gt;\r\n    &lt;\/head&gt;\r\n    &lt;body&gt;\r\n        &lt;h1&gt;WCG -- HTML5 Text Editor Example&lt;\/h1&gt;\r\n        &lt;div&gt;\r\n            &lt;button id=\"btnBold\" &gt;Bold&lt;\/button&gt;\r\n            &lt;button id=\"btnItalic\" &gt;Italic&lt;\/button&gt;\r\n            &lt;button id=\"btnUnderline\" &gt;Underline&lt;\/button&gt;\r\n            &lt;button id=\"btnStrike\" &gt;Strike Through&lt;\/button&gt;\r\n            &lt;button id=\"btnSubscript\" &gt;Subscript&lt;\/button&gt;\r\n            &lt;button id=\"btnSuperscript\" &gt;Superscript&lt;\/button&gt;\r\n            &lt;button id=\"btnRemoveFormat\" &gt;Remove Format&lt;\/button&gt;\r\n        &lt;\/div&gt;\r\n        &lt;div&gt;\r\n            &lt;button id=\"btnCenter\" &gt;Justify Center&lt;\/button&gt;\r\n            &lt;button id=\"btnRight\" &gt;Justify Right&lt;\/button&gt;\r\n            &lt;button id=\"btnLeft\" &gt;Justify Left&lt;\/button&gt;\r\n            &lt;button id=\"btnIndent\" &gt;Indent&lt;\/button&gt;\r\n            &lt;button id=\"btnOutdent\" &gt;Outdent&lt;\/button&gt;\r\n        &lt;\/div&gt;\r\n        &lt;div id=\"editor\" contenteditable=\"true\" spellcheck=\"false\" &gt;\r\n        &lt;\/div&gt;\r\n\r\n        &lt;script type=\"text\/javascript\" src=\"js\/html5.text.editor.js\"&gt;&lt;\/script&gt;\r\n    &lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>Below our toolbar we add a <code>div<\/code> where the user is able to type and edit text. To make the <code>div<\/code> editable we decorate it with the <code>contenteditable=\"true\"<\/code> attribute.<\/p>\n<h3>4.2. CSS Rules<\/h3>\n<p>We setup CSS rules to style our text editor and to set the <code>height<\/code>, <code>width <\/code> and a <code>border<\/code> around it. We also make the display of the editor <code>div<\/code> as <code>block<\/code>. Our CSS file should look like below:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>html5.text.editor.css<\/em><\/span><\/p>\n<pre class=\"brush: css;\">#editor{\r\n    width: 50%;\r\n    height: 400px;\r\n    display: block;\r\n    border: 2px solid lightblue;\r\n    margin-top: 4px;\r\n}\r\n<\/pre>\n<h3>4.3. JavaScript<\/h3>\n<p>To make our editor tick we handle the <code>mousedown<\/code> events of each of our toolbar button. In the event handler we pass the appropriate parameters to the <code>execCommand()<\/code> method of the <code>document<\/code> object. Our JavaScript code looks like below:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>html5.text.editor.js<\/em><\/span><\/p>\n<pre class=\"brush: js;\">var btnBold = document.getElementById(\"btnBold\");\r\nvar btnItalic = document.getElementById(\"btnItalic\");\r\nvar btnUnderline = document.getElementById(\"btnUnderline\");\r\nvar btnStrike = document.getElementById(\"btnStrike\");\r\nvar btnSubscript = document.getElementById(\"btnSubscript\");\r\nvar btnRemoveFormat = document.getElementById(\"btnRemoveFormat\");\r\nvar btnSuperscript = document.getElementById(\"btnSuperscript\");\r\nvar btnCenter = document.getElementById(\"btnCenter\");\r\nvar btnRight = document.getElementById(\"btnRight\");\r\nvar btnLeft = document.getElementById(\"btnLeft\");\r\nvar btnIndent = document.getElementById(\"btnIndent\");\r\nvar btnOutdent = document.getElementById('btnOutdent');\r\nbtnOutdent.addEventListener('mousedown', function(event){\r\n    document.execCommand(\"outdent\")\r\n    event.preventDefault();\r\n});\r\nbtnIndent.addEventListener(\"mousedown\", function(event){\r\n    document.execCommand(\"indent\");\r\n    event.preventDefault();\r\n});\r\nbtnLeft.addEventListener(\"mousedown\", function(event){\r\n    document.execCommand(\"justifyLeft\");\r\n    event.preventDefault();\r\n});\r\nbtnRight.addEventListener(\"mousedown\", function(event){\r\n    document.execCommand(\"justifyRight\");\r\n    event.preventDefault();\r\n});\r\nbtnCenter.addEventListener('mousedown', function(event){\r\n    document.execCommand(\"justifyCenter\");\r\n    event.preventDefault();\r\n});\r\nbtnSuperscript.addEventListener(\"mousedown\", function(event){\r\n    \r\n    document.execCommand(\"superscript\");\r\n    event.preventDefault();\r\n    \r\n});\r\nbtnRemoveFormat.addEventListener(\"mousedown\", function(event){\r\n    \r\n    document.execCommand(\"removeFormat\");\r\n    event.preventDefault();\r\n    \r\n});\r\nbtnSubscript.addEventListener(\"mousedown\", function(event){\r\n    \r\n    document.execCommand(\"subscript\");\r\n    event.preventDefault();\r\n    \r\n});\r\nbtnStrike.addEventListener(\"mousedown\", function(event){\r\n    \r\n    document.execCommand(\"strikethrough\");\r\n    event.preventDefault();\r\n    \r\n});\r\nbtnBold.addEventListener(\"mousedown\", function(event){\r\n    \r\n    document.execCommand(\"bold\");\r\n    event.preventDefault();\r\n\r\n});\r\nbtnItalic.addEventListener(\"mousedown\", function(event){\r\n    \r\n    document.execCommand(\"italic\");\r\n    event.preventDefault();\r\n    \r\n});\r\nbtnUnderline.addEventListener(\"mousedown\", function(event){\r\n    \r\n    document.execCommand(\"underline\");\r\n    event.preventDefault();\r\n    \r\n});\r\n\r\n<\/pre>\n<h2>5. Running the Project<\/h2>\n<p>Now that we have everything setup let us go ahead and run the project and look at the output. Firstly, we need to run the following commands at the root of the project.<\/p>\n<pre class=\"brush: bash;\">&gt;npm install\r\n<\/pre>\n<p>and<\/p>\n<pre class=\"brush: bash;\">&gt;node index.js\r\n<\/pre>\n<p>Now we need to navigate to the URL <code>http:\/\/localhost:8090\/index.html<\/code>, We should see the below screen:<\/p>\n<figure id=\"attachment_19352\" aria-describedby=\"caption-attachment-19352\" style=\"width: 732px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/11\/ScreenLayoutTextEditorExample.jpg\"><img decoding=\"async\" class=\"size-full wp-image-19352\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/11\/ScreenLayoutTextEditorExample.jpg\" alt=\"\" width=\"732\" height=\"640\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/11\/ScreenLayoutTextEditorExample.jpg 732w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/11\/ScreenLayoutTextEditorExample-300x262.jpg 300w\" sizes=\"(max-width: 732px) 100vw, 732px\" \/><\/a><figcaption id=\"caption-attachment-19352\" class=\"wp-caption-text\">Screen Layout<\/figcaption><\/figure>\n<h2>6. Download the Source Code<\/h2>\n<p>That wraps up our look at building an In-browser text editor.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here : <a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2017\/11\/WCG-HTML5-Text-Editor-Example.zip\"><strong>WCG &#8212; HTML5 Text Editor Example<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this post, we will take a look at the implementation of an In-browser text editor. The editor will provide basic editing functionality like making the text bold, italic, underline, strikeout and indentation, alignment of blocks of text. A text editor provides useful functionality that can be leveraged in blog comments section apart from other &hellip;<\/p>\n","protected":false},"author":213,"featured_media":914,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[58],"class_list":["post-19177","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-html5","tag-html5-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>HTML5 Text Editor Example - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"In this post, we will take a look at the implementation of an In-browser text editor. The editor will provide basic editing functionality like making the\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HTML5 Text Editor Example - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"In this post, we will take a look at the implementation of an In-browser text editor. The editor will provide basic editing functionality like making the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2017-11-29T14:15:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-19T10:55:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Siddharth Seth\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Siddharth Seth\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/\"},\"author\":{\"name\":\"Siddharth Seth\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/9c939eb4c915443c7e493c813d979592\"},\"headline\":\"HTML5 Text Editor Example\",\"datePublished\":\"2017-11-29T14:15:27+00:00\",\"dateModified\":\"2017-12-19T10:55:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/\"},\"wordCount\":502,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\",\"keywords\":[\"html5\"],\"articleSection\":[\"HTML5\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/\",\"name\":\"HTML5 Text Editor Example - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\",\"datePublished\":\"2017-11-29T14:15:27+00:00\",\"dateModified\":\"2017-12-19T10:55:21+00:00\",\"description\":\"In this post, we will take a look at the implementation of an In-browser text editor. The editor will provide basic editing functionality like making the\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"HTML5\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/html5\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"HTML5 Text Editor Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/9c939eb4c915443c7e493c813d979592\",\"name\":\"Siddharth Seth\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g\",\"caption\":\"Siddharth Seth\"},\"description\":\"Siddharth is a Software Development Professional with a Master degree in Computer Applications from IGNOU. He has over 14 years of experience. And currently focused on Software Architecture, Cloud Computing, JavaScript Frameworks for Client and Server, Business Intelligence.\",\"sameAs\":[\"https:\/\/www.webcodegeeks.com\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/siddharth-seth\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HTML5 Text Editor Example - Web Code Geeks - 2026","description":"In this post, we will take a look at the implementation of an In-browser text editor. The editor will provide basic editing functionality like making the","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/","og_locale":"en_US","og_type":"article","og_title":"HTML5 Text Editor Example - Web Code Geeks - 2026","og_description":"In this post, we will take a look at the implementation of an In-browser text editor. The editor will provide basic editing functionality like making the","og_url":"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2017-11-29T14:15:27+00:00","article_modified_time":"2017-12-19T10:55:21+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","type":"image\/jpeg"}],"author":"Siddharth Seth","twitter_card":"summary_large_image","twitter_creator":"@webcodegeeks","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Siddharth Seth","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/"},"author":{"name":"Siddharth Seth","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/9c939eb4c915443c7e493c813d979592"},"headline":"HTML5 Text Editor Example","datePublished":"2017-11-29T14:15:27+00:00","dateModified":"2017-12-19T10:55:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/"},"wordCount":502,"commentCount":1,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","keywords":["html5"],"articleSection":["HTML5"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/","url":"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/","name":"HTML5 Text Editor Example - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","datePublished":"2017-11-29T14:15:27+00:00","dateModified":"2017-12-19T10:55:21+00:00","description":"In this post, we will take a look at the implementation of an In-browser text editor. The editor will provide basic editing functionality like making the","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/html5-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/html5\/html5-text-editor-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"HTML5","item":"https:\/\/www.webcodegeeks.com\/category\/html5\/"},{"@type":"ListItem","position":3,"name":"HTML5 Text Editor Example"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/9c939eb4c915443c7e493c813d979592","name":"Siddharth Seth","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/86a5133a5e9d79f7997e2649b1afe58e895c0d88df47b3359103ec4c1a2077d6?s=96&d=mm&r=g","caption":"Siddharth Seth"},"description":"Siddharth is a Software Development Professional with a Master degree in Computer Applications from IGNOU. He has over 14 years of experience. And currently focused on Software Architecture, Cloud Computing, JavaScript Frameworks for Client and Server, Business Intelligence.","sameAs":["https:\/\/www.webcodegeeks.com"],"url":"https:\/\/www.webcodegeeks.com\/author\/siddharth-seth\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/19177","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/213"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=19177"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/19177\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/914"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=19177"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=19177"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=19177"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}