{"id":10300,"date":"2024-01-18T18:18:00","date_gmt":"2024-01-18T18:18:00","guid":{"rendered":"https:\/\/codehim.com\/?p=10300"},"modified":"2024-01-22T16:19:09","modified_gmt":"2024-01-22T11:19:09","slug":"html5-text-editor-with-file-reader-api","status":"publish","type":"post","link":"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/","title":{"rendered":"HTML5 Text Editor With File Reader API"},"content":{"rendered":"<p>This code creates an HTML5 text editor using <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/FileReader\" target=\"_blank\" rel=\"noopener\">File Reader APIs<\/a>. It lets you create, edit, and delete text files. The text editor interface allows you to enter a filename, type content, and save it as a file. You can also browse existing files, load them for editing, and delete them if needed. The code manages file operations like saving, loading, and deleting within the browser using FileSystem API functionality.<\/p>\n<p>You can use this code to build a simple <a href=\"https:\/\/codehim.com\/html5-css3\/wysiwyg-rich-text-editor-with-html5-jquery\/\" target=\"_blank\" rel=\"noopener\">text editor<\/a> in a web browser. It&#8217;s handy for creating an interface to write, save, edit, and delete text files directly within the browser window. The major benefit is that it allows users to manage text files locally without needing an internet connection, handy for quick note-taking or local file management tasks.<\/p>\n<h2>How to Create HTML5 Text Editor With File Reader API<\/h2>\n<p>1. First of all, copy the following HTML code into your project. It includes the necessary structure for the text editor interface, such as the filename input, content textarea, save button, and file browser.<\/p>\n<pre class=\"prettyprint linenums lang-html\">&lt;div id=\"page-wrapper\" class=\"clearfix\"&gt;\r\n    &lt;h1&gt;HTML5 Text Editor&lt;\/h1&gt;\r\n    &lt;p&gt;Powered by the FileSystem APIs.&lt;\/p&gt;\r\n\r\n    &lt;form action=\"#\" method=\"POST\" id=\"file-form\"&gt;\r\n      &lt;div class=\"field\"&gt;\r\n        &lt;input type=\"text\" name=\"filename\" id=\"filename\" placeholder=\"Filename (e.g. treehouse.txt)\"&gt;\r\n      &lt;\/div&gt;\r\n      &lt;div class=\"field\"&gt;\r\n        &lt;textarea name=\"content\" id=\"content\" placeholder=\"Type your content here...\"&gt;&lt;\/textarea&gt;\r\n      &lt;\/div&gt;\r\n      &lt;div class=\"field\"&gt;\r\n        &lt;button type=\"submit\"&gt;Save File&lt;\/button&gt;\r\n        &lt;div id=\"messages\"&gt;&lt;\/div&gt;\r\n      &lt;\/div&gt;\r\n    &lt;\/form&gt;\r\n\r\n    &lt;div id=\"files\"&gt;\r\n      &lt;h2&gt;File Browser&lt;\/h2&gt;\r\n      &lt;ul id=\"file-list\"&gt;&lt;\/ul&gt;\r\n    &lt;\/div&gt;\r\n\r\n  &lt;\/div&gt;<\/pre>\n<p>2. The following CSS code enhances the visual appeal of the editor. Feel free to customize the styles to match your project&#8217;s design. The styles provide a clean and user-friendly interface for a seamless editing experience.<\/p>\n<pre class=\"prettyprint linenums lang-css\">*, *:before, *:after {\r\n  -moz-box-sizing: border-box;\r\n  -webkit-box-sizing: border-box;\r\n  box-sizing: border-box;\r\n}\r\n\r\nhtml {\r\n  font-family: Helvetica, Arial, sans-serif;\r\n  font-size: 100%;\r\n  background: #333;\r\n  color: #33383D;\r\n  -webkit-font-smoothing: antialiased;\r\n}\r\n\r\n#page-wrapper {\r\n  width: 960px;\r\n  background: #FFF;\r\n  padding: 1.25rem;\r\n  margin: 1rem auto;\r\n  min-height: 300px;\r\n  border-top: 5px solid #69c773;\r\n  box-shadow: 0 2px 10px rgba(0,0,0,0.8);\r\n}\r\n\r\nh1 {\r\n  margin: 0;\r\n}\r\n\r\nh2 {\r\n  margin-top: 0;\r\n  font-size: 0.9rem;\r\n  text-transform: uppercase;\r\n  letter-spacing: 1px;\r\n  color: #999;\r\n}\r\n\r\np {\r\n  font-size: 0.9rem;\r\n  margin: 0.5rem 0 1.5rem 0;\r\n}\r\n\r\na,\r\na:visited {\r\n  color: #08C;\r\n  text-decoration: none;\r\n}\r\n\r\na:hover,\r\na:focus {\r\n  color: #69c773;\r\n  cursor: pointer;\r\n}\r\n\r\na.delete-file,\r\na.delete-file:visited {\r\n  color: #CC0000;\r\n  margin-left: 0.5rem;\r\n}\r\n\r\n#file-form {\r\n  width: 650px;\r\n  float: left;\r\n}\r\n\r\n.field {\r\n  margin-bottom: 1rem;\r\n}\r\n\r\ninput,\r\ntextarea {\r\n  width: 100%;\r\n  padding: 0.5rem;\r\n  font-size: 1rem;\r\n  border: 1px solid #D9D9D9;\r\n  border-radius: 3px;\r\n  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1);\r\n}\r\n\r\ntextarea {\r\n  min-height: 300px;\r\n}\r\n\r\nbutton {\r\n  display: inline-block;\r\n  border-radius: 3px;\r\n  border: none;\r\n  font-size: 0.9rem;\r\n  padding: 0.6rem 1em;\r\n  background: #86b32d;\r\n  border-bottom: 1px solid #5d7d1f;\r\n  color: white;\r\n  margin: 0 0.25rem;\r\n  text-align: center;\r\n}\r\n\r\nbutton:hover {\r\n  opacity: 0.75;\r\n  cursor: pointer;\r\n}\r\n\r\n#files {\r\n  width: 230px;\r\n  float: right;\r\n}\r\n\r\n#files ul {\r\n  margin: 0;\r\n  padding: 0.5rem 1rem;\r\n  height: 330px;\r\n  overflow-y: auto;\r\n  list-style: none;\r\n  background: #F7F7F7;\r\n  border: 1px solid #D9D9D9;\r\n  border-radius: 3px;\r\n  box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.1);\r\n}\r\n\r\n#files li {\r\n  padding: 0.5rem 0;\r\n}\r\n\r\n#messages {\r\n  display: inline-block;\r\n  font-weight: bold;\r\n  color: #69c773;\r\n  margin-left: 1rem;\r\n}\r\n\r\n\/* Clearfix Utils *\/\r\n\r\n.clearfix {\r\n  *zoom: 1;\r\n}\r\n\r\n.clearfix:before,\r\n.clearfix:after {\r\n  display: table;\r\n  line-height: 0;\r\n  content: \"\";\r\n}\r\n\r\n.clearfix:after {\r\n  clear: both;\r\n}<\/pre>\n<p>3. The JavaScript code handles the core functionality of the text editor. It utilizes the File Reader API to manage file operations. The code includes functions for initializing the file system, loading files, saving files, and deleting files.<\/p>\n<pre class=\"prettyprint linenums lang-js\">\/\/ Allow for vendor prefixes.\r\nwindow.requestFileSystem = window.requestFileSystem ||\r\n                           window.webkitRequestFileSystem;\r\n\r\n\r\n\/\/ Create a variable that will store a reference to the FileSystem.\r\nvar filesystem = null;\r\n\r\n\/\/ Get references to the page elements.\r\nvar form = document.getElementById('file-form');\r\nvar filenameInput = document.getElementById('filename');\r\nvar contentTextArea = document.getElementById('content');\r\n\r\nvar fileList = document.getElementById('file-list');\r\n\r\nvar messageBox = document.getElementById('messages');\r\n\r\n\r\n\/\/ A simple error handler to be used throughout this demo.\r\nfunction errorHandler(error) {\r\n  var message = '';\r\n\r\n  switch (error.code) {\r\n    case FileError.SECURITY_ERR:\r\n      message = 'Security Error';\r\n      break;\r\n    case FileError.NOT_FOUND_ERR:\r\n      message = 'Not Found Error';\r\n      break;\r\n    case FileError.QUOTA_EXCEEDED_ERR:\r\n      message = 'Quota Exceeded Error';\r\n      break;\r\n    case FileError.INVALID_MODIFICATION_ERR:\r\n      message = 'Invalid Modification Error';\r\n      break;\r\n    case FileError.INVALID_STATE_ERR:\r\n      message = 'Invalid State Error';\r\n      break;\r\n    default:\r\n      message = 'Unknown Error';\r\n      break;\r\n  }\r\n\r\n  console.log(message);\r\n}\r\n\r\n\r\n\/\/ Request a FileSystem and set the filesystem variable.\r\nfunction initFileSystem() {\r\n  navigator.webkitPersistentStorage.requestQuota(1024 * 1024 * 5,\r\n    function(grantedSize) {\r\n\r\n      \/\/ Request a file system with the new size.\r\n      window.requestFileSystem(window.PERSISTENT, grantedSize, function(fs) {\r\n\r\n        \/\/ Set the filesystem variable.\r\n        filesystem = fs;\r\n\r\n        \/\/ Setup event listeners on the form.\r\n        setupFormEventListener();\r\n\r\n        \/\/ Update the file browser.\r\n        listFiles();\r\n\r\n      }, errorHandler);\r\n\r\n    }, errorHandler);\r\n}\r\n\r\n\r\nfunction loadFile(filename) {\r\n  filesystem.root.getFile(filename, {}, function(fileEntry) {\r\n\r\n    fileEntry.file(function(file) {\r\n      var reader = new FileReader();\r\n\r\n      reader.onload = function(e) {\r\n        \/\/ Update the form fields.\r\n        filenameInput.value = filename;\r\n        contentTextArea.value = this.result;\r\n      };\r\n\r\n      reader.readAsText(file);\r\n    }, errorHandler);\r\n\r\n  }, errorHandler);\r\n}\r\n\r\n\r\nfunction displayEntries(entries) {\r\n  \/\/ Clear out the current file browser entries.\r\n  fileList.innerHTML = '';\r\n\r\n  entries.forEach(function(entry, i) {\r\n    var li = document.createElement('li');\r\n\r\n    var link = document.createElement('a');\r\n    link.innerHTML = entry.name;\r\n    link.className = 'edit-file';\r\n    li.appendChild(link);\r\n\r\n    var delLink = document.createElement('a');\r\n    delLink.innerHTML = '[x]';\r\n    delLink.className = 'delete-file';\r\n    li.appendChild(delLink);\r\n\r\n    fileList.appendChild(li);\r\n\r\n    \/\/ Setup an event listener that will load the file when the link\r\n    \/\/ is clicked.\r\n    link.addEventListener('click', function(e) {\r\n      e.preventDefault();\r\n      loadFile(entry.name);\r\n    });\r\n\r\n    \/\/ Setup an event listener that will delete the file when the delete link\r\n    \/\/ is clicked.\r\n    delLink.addEventListener('click', function(e) {\r\n      e.preventDefault();\r\n      deleteFile(entry.name);\r\n    });\r\n  });\r\n}\r\n\r\n\r\nfunction listFiles() {\r\n  var dirReader = filesystem.root.createReader();\r\n  var entries = [];\r\n\r\n  var fetchEntries = function() {\r\n    dirReader.readEntries(function(results) {\r\n      if (!results.length) {\r\n        displayEntries(entries.sort().reverse());\r\n      } else {\r\n        entries = entries.concat(results);\r\n        fetchEntries();\r\n      }\r\n    }, errorHandler);\r\n  };\r\n\r\n  fetchEntries();\r\n}\r\n\r\n\r\n\/\/ Save a file in the FileSystem.\r\nfunction saveFile(filename, content) {\r\n  filesystem.root.getFile(filename, {create: true}, function(fileEntry) {\r\n\r\n    fileEntry.createWriter(function(fileWriter) {\r\n\r\n      fileWriter.onwriteend = function(e) {\r\n        \/\/ Update the file browser.\r\n        listFiles();\r\n\r\n        \/\/ Clean out the form field.\r\n        filenameInput.value = '';\r\n        contentTextArea.value = '';\r\n\r\n        \/\/ Show a saved message.\r\n        messageBox.innerHTML = 'File saved!';\r\n      };\r\n\r\n      fileWriter.onerror = function(e) {\r\n        console.log('Write error: ' + e.toString());\r\n        alert('An error occurred and your file could not be saved!');\r\n      };\r\n\r\n      var contentBlob = new Blob([content], {type: 'text\/plain'});\r\n\r\n      fileWriter.write(contentBlob);\r\n\r\n    }, errorHandler);\r\n\r\n  }, errorHandler);\r\n}\r\n\r\n\r\nfunction deleteFile(filename) {\r\n  filesystem.root.getFile(filename, {create: false}, function(fileEntry) {\r\n\r\n    fileEntry.remove(function(e) {\r\n      \/\/ Update the file browser.\r\n      listFiles();\r\n\r\n      \/\/ Show a deleted message.\r\n      messageBox.innerHTML = 'File deleted!';\r\n    }, errorHandler);\r\n\r\n  }, errorHandler);\r\n}\r\n\r\n\r\n\/\/ Add event listeners on the form.\r\nfunction setupFormEventListener() {\r\n\r\n  form.addEventListener('submit', function(e) {\r\n    e.preventDefault();\r\n\r\n    \/\/ Get the form data.\r\n    var filename = filenameInput.value;\r\n    var content = contentTextArea.value;\r\n\r\n    \/\/ Save the file.\r\n    saveFile(filename, content);\r\n  });\r\n\r\n}\r\n\r\n\/\/ Start the app by requesting a FileSystem (if the browser supports the API)\r\nif (window.requestFileSystem) {\r\n  initFileSystem();\r\n} else {\r\n  alert('Sorry! Your browser doesnt support the FileSystem API :(');\r\n}<\/pre>\n<p>Feel free to customize the code to suit your needs. You can add additional features, improve the user interface, or integrate it into a larger web application.<\/p>\n<p>That&#8217;s all! hopefully, you have successfully created Html5 Text Editor With File Reader API. If you have any questions or suggestions, feel free to comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This code creates an HTML5 text editor using File Reader APIs. It lets you create, edit, and delete text files&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":10308,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[97],"tags":[224],"class_list":["post-10300","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-text-input","tag-text-editor"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>HTML5 Text Editor With File Reader API &#8212; CodeHim<\/title>\n<meta name=\"description\" content=\"Here is a free code snippet to create a HTML5 Text Editor With File Reader API. You can view demo and download the source code.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"HTML5 Text Editor With File Reader API &#8212; CodeHim\" \/>\n<meta property=\"og:description\" content=\"Here is a free code snippet to create a HTML5 Text Editor With File Reader API. You can view demo and download the source code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/\" \/>\n<meta property=\"og:site_name\" content=\"CodeHim\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codehimofficial\" \/>\n<meta property=\"article:published_time\" content=\"2024-01-18T18:18:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-22T11:19:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/HTML5-Text-Editor-With-File-Reader-API.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"980\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Asif Mughal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@CodeHimOfficial\" \/>\n<meta name=\"twitter:site\" content=\"@CodeHimOfficial\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Asif Mughal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/\"},\"author\":{\"name\":\"Asif Mughal\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\"},\"headline\":\"HTML5 Text Editor With File Reader API\",\"datePublished\":\"2024-01-18T18:18:00+00:00\",\"dateModified\":\"2024-01-22T11:19:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/\"},\"wordCount\":309,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/HTML5-Text-Editor-With-File-Reader-API.png\",\"keywords\":[\"Text Editor\"],\"articleSection\":[\"Text &amp; Input\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/\",\"url\":\"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/\",\"name\":\"HTML5 Text Editor With File Reader API &#8212; CodeHim\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/HTML5-Text-Editor-With-File-Reader-API.png\",\"datePublished\":\"2024-01-18T18:18:00+00:00\",\"dateModified\":\"2024-01-22T11:19:09+00:00\",\"description\":\"Here is a free code snippet to create a HTML5 Text Editor With File Reader API. You can view demo and download the source code.\",\"breadcrumb\":{\"@id\":\"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/#primaryimage\",\"url\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/HTML5-Text-Editor-With-File-Reader-API.png\",\"contentUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/HTML5-Text-Editor-With-File-Reader-API.png\",\"width\":1280,\"height\":980,\"caption\":\"HTML5 Text Editor With File Reader API\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/codehim.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Text &amp; Input\",\"item\":\"https:\/\/codehim.com\/category\/text-input\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"HTML5 Text Editor With File Reader API\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/codehim.com\/#website\",\"url\":\"https:\/\/codehim.com\/\",\"name\":\"CodeHim\",\"description\":\"Web Design Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"alternateName\":\"Web Design Codes\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/codehim.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/codehim.com\/#organization\",\"name\":\"CodeHim - Web Design Code & Scripts\",\"url\":\"https:\/\/codehim.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/logo\/image\/\",\"url\":\"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg\",\"contentUrl\":\"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg\",\"width\":280,\"height\":280,\"caption\":\"CodeHim - Web Design Code & Scripts\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/codehimofficial\",\"https:\/\/x.com\/CodeHimOfficial\",\"https:\/\/www.instagram.com\/codehim\/\",\"https:\/\/www.linkedin.com\/company\/codehim\",\"https:\/\/co.pinterest.com\/codehim\/\",\"https:\/\/www.youtube.com\/@codehim\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\",\"name\":\"Asif Mughal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g\",\"caption\":\"Asif Mughal\"},\"description\":\"I code and create web elements for amazing people around the world. I like work with new people. New people new Experiences. I truly enjoy what I'm doing, which makes me more passionate about web development and coding. I am always ready to do challenging tasks whether it is about creating a custom CMS from scratch or customizing an existing system.\",\"sameAs\":[\"https:\/\/codehim.com\"],\"url\":\"https:\/\/codehim.com\/author\/asif-mughal\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"HTML5 Text Editor With File Reader API &#8212; CodeHim","description":"Here is a free code snippet to create a HTML5 Text Editor With File Reader API. You can view demo and download the source code.","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:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/","og_locale":"en_US","og_type":"article","og_title":"HTML5 Text Editor With File Reader API &#8212; CodeHim","og_description":"Here is a free code snippet to create a HTML5 Text Editor With File Reader API. You can view demo and download the source code.","og_url":"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/","og_site_name":"CodeHim","article_publisher":"https:\/\/www.facebook.com\/codehimofficial","article_published_time":"2024-01-18T18:18:00+00:00","article_modified_time":"2024-01-22T11:19:09+00:00","og_image":[{"width":1280,"height":980,"url":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/HTML5-Text-Editor-With-File-Reader-API.png","type":"image\/png"}],"author":"Asif Mughal","twitter_card":"summary_large_image","twitter_creator":"@CodeHimOfficial","twitter_site":"@CodeHimOfficial","twitter_misc":{"Written by":"Asif Mughal","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/#article","isPartOf":{"@id":"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/"},"author":{"name":"Asif Mughal","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed"},"headline":"HTML5 Text Editor With File Reader API","datePublished":"2024-01-18T18:18:00+00:00","dateModified":"2024-01-22T11:19:09+00:00","mainEntityOfPage":{"@id":"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/"},"wordCount":309,"commentCount":0,"publisher":{"@id":"https:\/\/codehim.com\/#organization"},"image":{"@id":"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/HTML5-Text-Editor-With-File-Reader-API.png","keywords":["Text Editor"],"articleSection":["Text &amp; Input"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/","url":"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/","name":"HTML5 Text Editor With File Reader API &#8212; CodeHim","isPartOf":{"@id":"https:\/\/codehim.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/#primaryimage"},"image":{"@id":"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/HTML5-Text-Editor-With-File-Reader-API.png","datePublished":"2024-01-18T18:18:00+00:00","dateModified":"2024-01-22T11:19:09+00:00","description":"Here is a free code snippet to create a HTML5 Text Editor With File Reader API. You can view demo and download the source code.","breadcrumb":{"@id":"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/#primaryimage","url":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/HTML5-Text-Editor-With-File-Reader-API.png","contentUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2023\/12\/HTML5-Text-Editor-With-File-Reader-API.png","width":1280,"height":980,"caption":"HTML5 Text Editor With File Reader API"},{"@type":"BreadcrumbList","@id":"https:\/\/codehim.com\/text-input\/html5-text-editor-with-file-reader-api\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/codehim.com\/"},{"@type":"ListItem","position":2,"name":"Text &amp; Input","item":"https:\/\/codehim.com\/category\/text-input\/"},{"@type":"ListItem","position":3,"name":"HTML5 Text Editor With File Reader API"}]},{"@type":"WebSite","@id":"https:\/\/codehim.com\/#website","url":"https:\/\/codehim.com\/","name":"CodeHim","description":"Web Design Code Snippets","publisher":{"@id":"https:\/\/codehim.com\/#organization"},"alternateName":"Web Design Codes","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/codehim.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/codehim.com\/#organization","name":"CodeHim - Web Design Code & Scripts","url":"https:\/\/codehim.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/#\/schema\/logo\/image\/","url":"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg","contentUrl":"http:\/\/codehim.com\/wp-content\/uploads\/2023\/06\/Codehim-short-logo.jpg","width":280,"height":280,"caption":"CodeHim - Web Design Code & Scripts"},"image":{"@id":"https:\/\/codehim.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codehimofficial","https:\/\/x.com\/CodeHimOfficial","https:\/\/www.instagram.com\/codehim\/","https:\/\/www.linkedin.com\/company\/codehim","https:\/\/co.pinterest.com\/codehim\/","https:\/\/www.youtube.com\/@codehim"]},{"@type":"Person","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed","name":"Asif Mughal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b25bfcd7d4e341c2c6f785a88d8ad2a4?s=96&d=mm&r=g","caption":"Asif Mughal"},"description":"I code and create web elements for amazing people around the world. I like work with new people. New people new Experiences. I truly enjoy what I'm doing, which makes me more passionate about web development and coding. I am always ready to do challenging tasks whether it is about creating a custom CMS from scratch or customizing an existing system.","sameAs":["https:\/\/codehim.com"],"url":"https:\/\/codehim.com\/author\/asif-mughal\/"}]}},"views":747,"_links":{"self":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/10300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/comments?post=10300"}],"version-history":[{"count":0,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/10300\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media\/10308"}],"wp:attachment":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media?parent=10300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/categories?post=10300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/tags?post=10300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}