{"id":10576,"date":"2024-03-03T10:30:00","date_gmt":"2024-03-03T10:30:00","guid":{"rendered":"https:\/\/codehim.com\/?p=10576"},"modified":"2024-03-04T08:30:43","modified_gmt":"2024-03-04T03:30:43","slug":"textarea-code-editor-with-syntax-highlighting","status":"publish","type":"post","link":"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/","title":{"rendered":"Textarea Code Editor With Syntax Highlighting"},"content":{"rendered":"<p>This code creates a dynamic code editor with a sleek design. The major functionality includes syntax highlighting, resizable textarea, and tab indentation. It empowers you to write and edit code effortlessly. The editor&#8217;s toolbar offers options for indentation preferences and fullscreen mode, enhancing your coding experience. With syntax highlighting powered by the popular highlight.js library, your code becomes more readable. Whether you&#8217;re a seasoned developer or just starting, this code editor is here to elevate your coding journey.<\/p>\n<h2>How to Create Textarea Code Editor With Syntax Highlighting<\/h2>\n<p>1. First of all, load the following assets into the head tag of your HTML document.<\/p>\n<pre class=\"prettyprint linenums lang-html\">&lt;link rel='stylesheet' href='https:\/\/cdn.jsdelivr.net\/foundation\/6.2.0\/foundation.min.css'&gt;<\/pre>\n<p>2. Create an HTML file and include a textarea element with the class &#8220;editor&#8221; to serve as your code input space. Add a <code>&lt;code&gt;<\/code> element where your highlighted code will be displayed.<\/p>\n<pre class=\"prettyprint linenums lang-html\">&lt;div class=\"editor-holder\"&gt;\r\n\t&lt;ul class=\"toolbar\"&gt;\r\n\t\t&lt;li&gt;&lt;a href=\"#\" id=\"indent\" title=\"Toggle tabs or spaces\"&gt;&lt;i class=\"fa fa-indent\"&gt;&lt;\/i&gt;&lt;\/a&gt;&lt;\/li&gt;\r\n\t\t&lt;li&gt;&lt;a href=\"#\" id=\"fullscreen\" title=\"Toggle fullscreen mode\"&gt;&lt;i class=\"fa fa-expand\"&gt;&lt;\/i&gt;&lt;\/a&gt;&lt;\/li&gt;\r\n\t&lt;\/ul&gt;\r\n\t&lt;div class=\"scroller\"&gt;\r\n\t\t&lt;textarea class=\"editor allow-tabs\"&gt;&amp;lt;div class=\"Editable Textarea\"&amp;gt;\r\n  &amp;lt;h1&amp;gt;This is a fully editable textarea which auto highlights syntax.&amp;lt;\/h1&amp;gt;\r\n  &amp;lt;p&amp;gt;Type or paste any code in here...&amp;lt;\/p&amp;gt;\r\n&amp;lt;div&amp;gt;\r\n\r\n&amp;lt;?php\r\n  var simple = \"coding\";\r\n?&amp;gt;\r\n\r\n&amp;lt;script&amp;gt;\r\n  with = \"Tab or double space functionality\";\r\n&amp;lt;\/script&amp;gt;&lt;\/textarea&gt;\r\n\t\t&lt;pre&gt;&lt;code class=\"syntax-highight html\"&gt;&lt;\/code&gt;&lt;\/pre&gt;\r\n\t&lt;\/div&gt;\r\n&lt;\/div&gt;<\/pre>\n<p>3. Style using the following CSS styles:<\/p>\n<pre class=\"prettyprint linenums lang-css\">body {\r\n  margin: 0;\r\n  padding: 0;\r\n  height: 100%;\r\n  width: 100%;\r\n  position: relative;\r\n  background: #72c3c3 !important;\r\n}\r\n\r\n.editor-holder {\r\n  width: 800px;\r\n  height: 500px;\r\n  margin-top: 50px;\r\n  border-radius: 3px;\r\n  position: relative;\r\n  top: 0;\r\n  background: #1f1f1f !important;\r\n  overflow: auto;\r\n  box-shadow: 5px 5px 10px 0px rgba(0, 0, 0, 0.4);\r\n  transition: all 0.5s ease-in-out;\r\n}\r\n.editor-holder.fullscreen {\r\n  width: 100%;\r\n  height: 100%;\r\n  margin: 0;\r\n  left: 0;\r\n}\r\n.editor-holder .toolbar {\r\n  width: 100%;\r\n  list-style: none;\r\n  position: absolute;\r\n  top: -2px;\r\n  margin: 0;\r\n  left: 0;\r\n  z-index: 3;\r\n  padding: 8px;\r\n  background: #afafaf;\r\n}\r\n.editor-holder .toolbar li {\r\n  display: inline-block;\r\n}\r\n.editor-holder .toolbar a {\r\n  line-height: 20px;\r\n  background: rgba(144, 144, 144, 0.6);\r\n  color: grey;\r\n  box-shadow: inset -1px -1px 1px 0px rgba(0, 0, 0, 0.28);\r\n  display: block;\r\n  border-radius: 3px;\r\n  cursor: pointer;\r\n}\r\n.editor-holder .toolbar a:hover {\r\n  background: rgba(144, 144, 144, 0.8);\r\n}\r\n.editor-holder .toolbar a.active {\r\n  background: rgba(144, 144, 144, 0.8);\r\n  box-shadow: none;\r\n}\r\n.editor-holder .toolbar i {\r\n  color: #565656;\r\n  padding: 8px;\r\n}\r\n.editor-holder textarea, .editor-holder code {\r\n  width: 100%;\r\n  height: auto;\r\n  min-height: 450px;\r\n  font-size: 14px;\r\n  border: 0;\r\n  margin: 0;\r\n  top: 46px;\r\n  left: 0;\r\n  padding: 20px !important;\r\n  line-height: 21px;\r\n  position: absolute;\r\n  font-family: Consolas, Liberation Mono, Courier, monospace;\r\n  overflow: visible;\r\n  transition: all 0.5s ease-in-out;\r\n}\r\n.editor-holder textarea {\r\n  background: transparent !important;\r\n  z-index: 2;\r\n  height: auto;\r\n  resize: none;\r\n  color: #fff;\r\n  text-shadow: 0px 0px 0px rgba(0, 0, 0, 0);\r\n  text-fill-color: transparent;\r\n  -webkit-text-fill-color: transparent;\r\n}\r\n.editor-holder textarea::-webkit-input-placeholder {\r\n  color: white;\r\n}\r\n.editor-holder textarea:focus {\r\n  outline: 0;\r\n  border: 0;\r\n  box-shadow: none;\r\n}\r\n.editor-holder code {\r\n  z-index: 1;\r\n}\r\n\r\npre {\r\n  white-space: pre-wrap;\r\n  white-space: -moz-pre-wrap;\r\n  white-space: -pre-wrap;\r\n  white-space: -o-pre-wrap;\r\n  word-wrap: break-word;\r\n}\r\npre code {\r\n  background: #1f1f1f !important;\r\n  color: #adadad;\r\n}\r\npre code .hljs {\r\n  color: #a9b7c6;\r\n  background: #282b2e;\r\n  display: block;\r\n  overflow-x: auto;\r\n  padding: 0.5em;\r\n}\r\npre code .hljs-number,\r\npre code .hljs-literal,\r\npre code .hljs-symbol,\r\npre code .hljs-bullet {\r\n  color: #6897BB;\r\n}\r\npre code .hljs-keyword,\r\npre code .hljs-selector-tag,\r\npre code .hljs-deletion {\r\n  color: #cc7832;\r\n}\r\npre code .hljs-variable,\r\npre code .hljs-template-variable,\r\npre code .hljs-link {\r\n  color: #629755;\r\n}\r\npre code .hljs-comment,\r\npre code .hljs-quote {\r\n  color: #808080;\r\n}\r\npre code .hljs-meta {\r\n  color: #bbb529;\r\n}\r\npre code .hljs-string,\r\npre code .hljs-attribute,\r\npre code .hljs-addition {\r\n  color: #6A8759;\r\n}\r\npre code .hljs-section,\r\npre code .hljs-title,\r\npre code .hljs-type {\r\n  color: #ffc66d;\r\n}\r\npre code .hljs-name,\r\npre code .hljs-selector-id,\r\npre code .hljs-selector-class {\r\n  color: #e8bf6a;\r\n}\r\npre code .hljs-emphasis {\r\n  font-style: italic;\r\n}\r\npre code .hljs-strong {\r\n  font-weight: bold;\r\n}<\/pre>\n<p>4. Load the<a href=\"https:\/\/jquery.com\" target=\"_blank\" rel=\"noopener\"> jQuery<\/a>, <a href=\"https:\/\/fontawesome.com\/docs\/web\/setup\/use-kit\" target=\"_blank\" rel=\"noopener\">Font Awesome Icons Kit<\/a>, Emmet JS and <a href=\"https:\/\/highlightjs.org\/\" target=\"_blank\" rel=\"noopener\">Highlight JS<\/a> by adding the following CDN links before closing the body tag:<\/p>\n<pre class=\"prettyprint linenums lang-html\">&lt;script src='https:\/\/code.jquery.com\/jquery-2.2.4.min.js'&gt;&lt;\/script&gt;\r\n&lt;script src='https:\/\/use.fontawesome.com\/b2c0f76220.js'&gt;&lt;\/script&gt;\r\n&lt;script src='https:\/\/raw.githubusercontent.com\/emmetio\/textarea\/master\/emmet.min.js'&gt;&lt;\/script&gt;\r\n&lt;script src='\/\/cdnjs.cloudflare.com\/ajax\/libs\/highlight.js\/9.5.0\/highlight.min.js'&gt;&lt;\/script&gt;\r\n\r\n<\/pre>\n<p>5. Finally, add the following JavaScript function to activate the code editor:<\/p>\n<pre class=\"prettyprint linenums lang-js\">var tabCharacter = \"  \";\r\nvar tabOffset = 2;\r\n\r\n$(document).on('click', '#indent', function(e){\r\n\te.preventDefault();\r\n\tvar self = $(this);\r\n\t\r\n\tself.toggleClass('active');\r\n\t\r\n\tif(self.hasClass('active'))\r\n\t{\r\n\t\ttabCharacter = \"\\t\";\r\n\t\ttabOffset = 1;\r\n\t}\r\n\telse\r\n\t{\r\n\t\ttabCharacter = \"  \";\r\n\t\ttabOffset = 2;\r\n\t}\r\n})\r\n\r\n$(document).on('click', '#fullscreen', function(e){\r\n\te.preventDefault();\r\n\tvar self = $(this);\r\n\t\r\n\tself.toggleClass('active');\r\n\tself.parents('.editor-holder').toggleClass('fullscreen');\r\n});\r\n\r\n\/*------------------------------------------\r\n\tRender existing code\r\n------------------------------------------*\/\r\n$(document).on('ready', function(){\r\n\thightlightSyntax();\r\n\t\r\n\temmet.require('textarea').setup({\r\n    pretty_break: true,\r\n    use_tab: true\r\n\t});\r\n});\r\n\r\n\r\n\r\n\r\n\/*------------------------------------------\r\n\tCapture text updates\r\n------------------------------------------*\/\r\n$(document).on('ready load keyup keydown change', '.editor', function(){\r\n\tcorrectTextareaHight(this);\r\n\thightlightSyntax();\r\n});\r\n\r\n\r\n\/*------------------------------------------\r\n\tResize textarea based on content  \r\n------------------------------------------*\/\r\nfunction correctTextareaHight(element)\r\n{\r\n  var self = $(element),\r\n      outerHeight = self.outerHeight(),\r\n      innerHeight = self.prop('scrollHeight'),\r\n      borderTop = parseFloat(self.css(\"borderTopWidth\")),\r\n      borderBottom = parseFloat(self.css(\"borderBottomWidth\")),\r\n      combinedScrollHeight = innerHeight + borderTop + borderBottom;\r\n  \r\n  if(outerHeight &lt; combinedScrollHeight )\r\n  {\r\n    self.height(combinedScrollHeight);\r\n  }\r\n}\r\n\/\/ function correctTextareaHight(element){\r\n\/\/ \twhile($(element).outerHeight() &lt; element.scrollHeight + parseFloat($(element).css(\"borderTopWidth\")) + parseFloat($(element).css(\"borderBottomWidth\"))) {\r\n\/\/ \t\t$(element).height($(element).height()+1);\r\n\/\/ \t};\r\n\/\/ }\r\n\r\n\r\n\/*------------------------------------------\r\n\tRun syntax hightlighter  \r\n------------------------------------------*\/\r\nfunction hightlightSyntax(){\r\n\tvar me  = $('.editor');\r\n\tvar content = me.val();\r\n\tvar codeHolder = $('code');\r\n\tvar escaped = escapeHtml(content);\r\n\t\r\n\tcodeHolder.html(escaped);\r\n\t\r\n\t$('.syntax-highight').each(function(i, block) {\r\n\t\thljs.highlightBlock(block);\r\n\t});\r\n}\r\n\r\n\r\n\/*------------------------------------------\r\n\tString html characters\r\n------------------------------------------*\/\r\nfunction escapeHtml(unsafe) {\r\n\treturn unsafe\r\n\t\t\t .replace(\/&amp;\/g, \"&amp;amp;\")\r\n\t\t\t .replace(\/&lt;\/g, \"&amp;lt;\")\r\n\t\t\t .replace(\/&gt;\/g, \"&amp;gt;\")\r\n\t\t\t .replace(\/\"\/g, \"&amp;quot;\")\r\n\t\t\t .replace(\/'\/g, \"&amp;#039;\");\r\n}\r\n\r\n\r\n\/*------------------------------------------\r\n\tEnable tabs in textarea\r\n------------------------------------------*\/\r\n$(document).delegate('.allow-tabs', 'keydown', function(e) {\r\n\tvar keyCode = e.keyCode || e.which;\r\n\r\n\tif (keyCode == 9) {\r\n\t\te.preventDefault();\r\n\t\tvar start = $(this).get(0).selectionStart;\r\n\t\tvar end = $(this).get(0).selectionEnd;\r\n\r\n\t\t\/\/ set textarea value to: text before caret + tab + text after caret\r\n\t\t$(this).val($(this).val().substring(0, start)\r\n\t\t\t\t\t\t\t\t+ tabCharacter\r\n\t\t\t\t\t\t\t\t+ $(this).val().substring(end));\r\n\r\n\t\t\/\/ put caret at right position again\r\n\t\t$(this).get(0).selectionStart =\r\n\t\t$(this).get(0).selectionEnd = start + tabOffset;\r\n\t}\r\n});<\/pre>\n<p>That&#8217;s all! hopefully, you have successfully created Textarea Code Editor With Syntax Highlighting. If you have any questions or suggestions, feel free to comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This code creates a dynamic code editor with a sleek design. The major functionality includes syntax highlighting, resizable textarea, and&#8230;<\/p>\n","protected":false},"author":1,"featured_media":10579,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[97],"tags":[],"class_list":["post-10576","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-text-input"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Textarea Code Editor With Syntax Highlighting &#8212; CodeHim<\/title>\n<meta name=\"description\" content=\"Here is a free code snippet to create a Textarea Code Editor With Syntax Highlighting. 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\/textarea-code-editor-with-syntax-highlighting\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Textarea Code Editor With Syntax Highlighting &#8212; CodeHim\" \/>\n<meta property=\"og:description\" content=\"Here is a free code snippet to create a Textarea Code Editor With Syntax Highlighting. You can view demo and download the source code.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/\" \/>\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-03-03T10:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-04T03:30:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Textarea-Code-Editor-With-Syntax-Highlighting.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"960\" \/>\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\/textarea-code-editor-with-syntax-highlighting\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/\"},\"author\":{\"name\":\"Asif Mughal\",\"@id\":\"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed\"},\"headline\":\"Textarea Code Editor With Syntax Highlighting\",\"datePublished\":\"2024-03-03T10:30:00+00:00\",\"dateModified\":\"2024-03-04T03:30:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/\"},\"wordCount\":207,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/codehim.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Textarea-Code-Editor-With-Syntax-Highlighting.png\",\"articleSection\":[\"Text &amp; Input\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/\",\"url\":\"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/\",\"name\":\"Textarea Code Editor With Syntax Highlighting &#8212; CodeHim\",\"isPartOf\":{\"@id\":\"https:\/\/codehim.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Textarea-Code-Editor-With-Syntax-Highlighting.png\",\"datePublished\":\"2024-03-03T10:30:00+00:00\",\"dateModified\":\"2024-03-04T03:30:43+00:00\",\"description\":\"Here is a free code snippet to create a Textarea Code Editor With Syntax Highlighting. You can view demo and download the source code.\",\"breadcrumb\":{\"@id\":\"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/#primaryimage\",\"url\":\"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Textarea-Code-Editor-With-Syntax-Highlighting.png\",\"contentUrl\":\"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Textarea-Code-Editor-With-Syntax-Highlighting.png\",\"width\":1280,\"height\":960,\"caption\":\"Textarea Code Editor With Syntax Highlighting\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/#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\":\"Textarea Code Editor With Syntax Highlighting\"}]},{\"@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":"Textarea Code Editor With Syntax Highlighting &#8212; CodeHim","description":"Here is a free code snippet to create a Textarea Code Editor With Syntax Highlighting. 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\/textarea-code-editor-with-syntax-highlighting\/","og_locale":"en_US","og_type":"article","og_title":"Textarea Code Editor With Syntax Highlighting &#8212; CodeHim","og_description":"Here is a free code snippet to create a Textarea Code Editor With Syntax Highlighting. You can view demo and download the source code.","og_url":"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/","og_site_name":"CodeHim","article_publisher":"https:\/\/www.facebook.com\/codehimofficial","article_published_time":"2024-03-03T10:30:00+00:00","article_modified_time":"2024-03-04T03:30:43+00:00","og_image":[{"width":1280,"height":960,"url":"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Textarea-Code-Editor-With-Syntax-Highlighting.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\/textarea-code-editor-with-syntax-highlighting\/#article","isPartOf":{"@id":"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/"},"author":{"name":"Asif Mughal","@id":"https:\/\/codehim.com\/#\/schema\/person\/cc48f1dbe072a89a62a98171b7db43ed"},"headline":"Textarea Code Editor With Syntax Highlighting","datePublished":"2024-03-03T10:30:00+00:00","dateModified":"2024-03-04T03:30:43+00:00","mainEntityOfPage":{"@id":"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/"},"wordCount":207,"commentCount":0,"publisher":{"@id":"https:\/\/codehim.com\/#organization"},"image":{"@id":"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Textarea-Code-Editor-With-Syntax-Highlighting.png","articleSection":["Text &amp; Input"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/","url":"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/","name":"Textarea Code Editor With Syntax Highlighting &#8212; CodeHim","isPartOf":{"@id":"https:\/\/codehim.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/#primaryimage"},"image":{"@id":"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/#primaryimage"},"thumbnailUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Textarea-Code-Editor-With-Syntax-Highlighting.png","datePublished":"2024-03-03T10:30:00+00:00","dateModified":"2024-03-04T03:30:43+00:00","description":"Here is a free code snippet to create a Textarea Code Editor With Syntax Highlighting. You can view demo and download the source code.","breadcrumb":{"@id":"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/#primaryimage","url":"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Textarea-Code-Editor-With-Syntax-Highlighting.png","contentUrl":"https:\/\/codehim.com\/wp-content\/uploads\/2024\/01\/Textarea-Code-Editor-With-Syntax-Highlighting.png","width":1280,"height":960,"caption":"Textarea Code Editor With Syntax Highlighting"},{"@type":"BreadcrumbList","@id":"https:\/\/codehim.com\/text-input\/textarea-code-editor-with-syntax-highlighting\/#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":"Textarea Code Editor With Syntax Highlighting"}]},{"@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":1760,"_links":{"self":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/10576","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=10576"}],"version-history":[{"count":1,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/10576\/revisions"}],"predecessor-version":[{"id":11275,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/posts\/10576\/revisions\/11275"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media\/10579"}],"wp:attachment":[{"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/media?parent=10576"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/categories?post=10576"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codehim.com\/wp-json\/wp\/v2\/tags?post=10576"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}