{"id":1538,"date":"2016-05-19T18:59:22","date_gmt":"2016-05-19T18:59:22","guid":{"rendered":"https:\/\/www.codexworld.com\/?p=1538"},"modified":"2022-10-18T05:46:48","modified_gmt":"2022-10-18T05:46:48","slug":"add-wysiwyg-html-editor-to-textarea-website","status":"publish","type":"post","link":"https:\/\/www.codexworld.com\/add-wysiwyg-html-editor-to-textarea-website\/","title":{"rendered":"Add WYSIWYG HTML Editor to Textarea on Your Website"},"content":{"rendered":"<p>The full form of WYSIWYG is What You See Is What You Get, it lets users see what the end result will look like when the document is printed. Basically, the WYSIWYG editor is driven by JavaScript which lets users enter the formatted text. The WYSIWYG editor is converting the formatted text to HTML when the web form is submitted to the server.<\/p>\n<p>When you need to accept formatted text content or HTML content from the users on your website, using the WYSIWYG editor to textarea is required. There are many jQuery plugins are available for adding WYSIWYG editor to textarea. In this article, we&#8217;ll provide information about the best WYSIWYG HTML editor and show how to add an HTML editor to textarea on the web page.<\/p>\n<p>TinyMCE is a web-based WYSIWYG editor that enables you to convert HTML textarea fields or other HTML elements to an editor. You can easily embed a rich text editor in the web page using the TinyMCE plugin. In this tutorial, we will show you the simple steps to add a TinyMCE editor to your website by writing minimal JavaScript Code.<\/p>\n<h2>Install TinyMCE Plugin<\/h2>\n<p>Before getting started to integrate the TinyMCE editor in HTML, download the latest version of the TinyMCE jQuery plugin from the <a href=\"https:\/\/www.tiny.cloud\/get-tiny\/\" target=\"_blank\" rel=\"noopener\">official TinyMCE site<\/a>. Extract it and placed it into the web application directory.<br \/>\n<span class=\"note\">Note that:<\/span> You don&#8217;t need to download the plugin file separately, all the required files exist in our source code package.<\/p>\n<h2>Include TinyMCE JS Library<\/h2>\n<p>Load the tinymce.min.js file from the TinyMCE plugin directory to include the TinyMCE library in HTML page.<\/p>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"tinymce\/tinymce.min.js\"<\/span>&gt;<\/span><span class=\"undefined\"><\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">script<\/span>&gt;<\/span><\/pre>\n<h2>Add WYSIWYG HTML Editor to Textarea<\/h2>\n<p>Now, we will show you how to attach the TinyMCE editor to an HTML element and convert textarea to a rich text HTML editor on the webpage.<br \/>\n<b>HTML Code:<\/b><br \/>\nDefine a Textarea input HTML where the WYSIWYG HTML Editor will be added.<\/p>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">textarea<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"myTextarea\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">textarea<\/span>&gt;<\/span><\/pre>\n<p><b>JavaScript Code:<\/b><br \/>\nInitialize TinyMCE plugin: Use the <code>tinymce.init()<\/code> method to initialize the TinyMCE plugin and attach it to the HTML element on the webpage. The element needs to be specified in the <code>selector<\/code> option and passed as an object in <code>tinymce.init()<\/code>.<\/p>\n<p>The following example code will replace the Textarea field with the TinyMCE editor instance using the selector <code>#myTextarea<\/code>. This code provides some default features of the TinyMCE editor for basic uses.<\/p>\n<pre style=\"color: rgb(110, 107, 94);\">tinymce.init({\r\n    selector: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'#myTextarea'<\/span>\r\n});<\/pre>\n<p>Now, the textarea element will replace with an HTML editor and display like the following screen.<\/p>\n<div class=\"img_center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/tinymce-wysiwyg-html-editor-plugin-basic-features-codexworld-1024x439.png\" alt=\"tinymce-wysiwyg-html-editor-plugin-basic-features-codexworld\" width=\"960\" height=\"412\" class=\"alignnone size-large wp-image-5099\" srcset=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/tinymce-wysiwyg-html-editor-plugin-basic-features-codexworld-1024x439.png 1024w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/tinymce-wysiwyg-html-editor-plugin-basic-features-codexworld-300x129.png 300w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/tinymce-wysiwyg-html-editor-plugin-basic-features-codexworld-768x330.png 768w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/tinymce-wysiwyg-html-editor-plugin-basic-features-codexworld-200x86.png 200w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/tinymce-wysiwyg-html-editor-plugin-basic-features-codexworld-346x148.png 346w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/tinymce-wysiwyg-html-editor-plugin-basic-features-codexworld.png 1212w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/div>\n<h2>Configuration Options<\/h2>\n<p>Some useful configuration options of the TinyMCE plugin are given below.<\/p>\n<p><b>height:<\/b><br \/>\nUse the <code>height<\/code> option to set the height of the editor including the menu and toolbars.<\/p>\n<pre style=\"color: rgb(110, 107, 94);\">tinymce.init({\r\n    selector: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'#myTextarea'<\/span>,\r\n    height: <span class=\"hljs-number\" style=\"color: rgb(182, 86, 17);\">300<\/span>\r\n});<\/pre>\n<p><b>width:<\/b><br \/>\nUse the <code>width<\/code> option to set the width of the editor.<\/p>\n<pre style=\"color: rgb(110, 107, 94);\">tinymce.init({\r\n    selector: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'#myTextarea'<\/span>,\r\n    width: <span class=\"hljs-number\" style=\"color: rgb(182, 86, 17);\">300<\/span>\r\n});<\/pre>\n<p><b>placeholder:<\/b><br \/>\nIf you want to set the placeholder text from JavaScript, use the <code>placeholder<\/code> option in tinymce.init() object.<\/p>\n<pre style=\"color: rgb(110, 107, 94);\">tinymce.init({\r\n    selector: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'#myTextarea'<\/span>,\r\n    placeholder: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'Type here...'<\/span>\r\n});<\/pre>\n<h2>Full featured TinyMCE editor<\/h2>\n<p>The following example code displays all features available in TinyMCE for advanced uses.<\/p>\n<pre style=\"color: rgb(110, 107, 94);\">tinymce.init({\r\n    selector: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'#myTextarea'<\/span>,\r\n    plugins: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'preview importcss searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap pagebreak nonbreaking anchor insertdatetime advlist lists wordcount help charmap quickbars emoticons'<\/span>,\r\n    menubar: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'file edit view insert format tools table help'<\/span>,\r\n    toolbar: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'undo redo | bold italic underline strikethrough | fontfamily fontsize blocks | alignleft aligncenter alignright alignjustify | outdent indent |  numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen  preview save print | insertfile image media template link anchor codesample | ltr rtl'<\/span>,\r\n    toolbar_sticky: <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">true<\/span>,\r\n    autosave_ask_before_unload: <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">true<\/span>,\r\n    autosave_interval: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'30s'<\/span>,\r\n    autosave_prefix: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'{path}{query}-{id}-'<\/span>,\r\n    autosave_restore_when_empty: <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">false<\/span>,\r\n    autosave_retention: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'2m'<\/span>,\r\n    image_advtab: <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">true<\/span>,\r\n    link_list: [\r\n      { title: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'My page 1'<\/span>, value: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'https:\/\/www.codexworld.com'<\/span> },\r\n      { title: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'My page 2'<\/span>, value: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'http:\/\/www.codexqa.com'<\/span> }\r\n    ],\r\n    image_list: [\r\n      { title: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'My page 1'<\/span>, value: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'https:\/\/www.codexworld.com'<\/span> },\r\n      { title: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'My page 2'<\/span>, value: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'http:\/\/www.codexqa.com'<\/span> }\r\n    ],\r\n    image_class_list: [\r\n      { title: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'None'<\/span>, value: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">''<\/span> },\r\n      { title: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'Some class'<\/span>, value: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'class-name'<\/span> }\r\n    ],\r\n    importcss_append: <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">true<\/span>,\r\n    file_picker_callback: (callback, value, meta) =&gt; {\r\n      <span class=\"hljs-comment\" style=\"color: rgb(125, 122, 104);\">\/* Provide file and text for the link dialog *\/<\/span>\r\n      <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">if<\/span> (meta.filetype === <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'file'<\/span>) {\r\n        callback(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'https:\/\/www.google.com\/logos\/google.jpg'<\/span>, { text: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'My text'<\/span> });\r\n      }\r\n  \r\n      <span class=\"hljs-comment\" style=\"color: rgb(125, 122, 104);\">\/* Provide image and alt text for the image dialog *\/<\/span>\r\n      <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">if<\/span> (meta.filetype === <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'image'<\/span>) {\r\n        callback(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'https:\/\/www.google.com\/logos\/google.jpg'<\/span>, { alt: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'My alt text'<\/span> });\r\n      }\r\n  \r\n      <span class=\"hljs-comment\" style=\"color: rgb(125, 122, 104);\">\/* Provide alternative source and posted for the media dialog *\/<\/span>\r\n      <span class=\"hljs-keyword\" style=\"color: rgb(184, 84, 212);\">if<\/span> (meta.filetype === <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'media'<\/span>) {\r\n        callback(<span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'movie.mp4'<\/span>, { source2: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'alt.ogg'<\/span>, poster: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'https:\/\/www.google.com\/logos\/google.jpg'<\/span> });\r\n      }\r\n    },\r\n    templates: [\r\n      { title: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'New Table'<\/span>, description: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'creates a new table'<\/span>, content: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'&lt;div class=\"mceTmpl\"&gt;&lt;table width=\"98%%\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\"&gt;&lt;tr&gt;&lt;th scope=\"col\"&gt; &lt;\/th&gt;&lt;th scope=\"col\"&gt; &lt;\/th&gt;&lt;\/tr&gt;&lt;tr&gt;&lt;td&gt; &lt;\/td&gt;&lt;td&gt; &lt;\/td&gt;&lt;\/tr&gt;&lt;\/table&gt;&lt;\/div&gt;'<\/span> },\r\n      { title: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'Starting my story'<\/span>, description: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'A cure for writers block'<\/span>, content: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'Once upon a time...'<\/span> },\r\n      { title: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'New list with dates'<\/span>, description: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'New List with dates'<\/span>, content: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'&lt;div class=\"mceTmpl\"&gt;&lt;span class=\"cdate\"&gt;cdate&lt;\/span&gt;&lt;br&gt;&lt;span class=\"mdate\"&gt;mdate&lt;\/span&gt;&lt;h2&gt;My List&lt;\/h2&gt;&lt;ul&gt;&lt;li&gt;&lt;\/li&gt;&lt;li&gt;&lt;\/li&gt;&lt;\/ul&gt;&lt;\/div&gt;'<\/span> }\r\n    ],\r\n    template_cdate_format: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'[Date Created (CDATE): %m\/%d\/%Y : %H:%M:%S]'<\/span>,\r\n    template_mdate_format: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'[Date Modified (MDATE): %m\/%d\/%Y : %H:%M:%S]'<\/span>,\r\n    height: <span class=\"hljs-number\" style=\"color: rgb(182, 86, 17);\">400<\/span>,\r\n    image_caption: <span class=\"hljs-literal\" style=\"color: rgb(182, 86, 17);\">true<\/span>,\r\n    quickbars_selection_toolbar: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'bold italic | quicklink h2 h3 blockquote quickimage quicktable'<\/span>,\r\n    noneditable_class: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'mceNonEditable'<\/span>,\r\n    toolbar_mode: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'sliding'<\/span>,\r\n    contextmenu: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'link image table'<\/span>,\r\n    content_style: <span class=\"hljs-string\" style=\"color: rgb(96, 172, 57);\">'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }'<\/span>\r\n});<\/pre>\n<div class=\"img_center\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/tinymce-wysiwyg-html-editor-plugin-advanced-full-featured-codexworld-1024x441.png\" alt=\"tinymce-wysiwyg-html-editor-plugin-advanced-full-featured-codexworld\" width=\"960\" height=\"413\" class=\"alignnone size-large wp-image-5100\" srcset=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/tinymce-wysiwyg-html-editor-plugin-advanced-full-featured-codexworld-1024x441.png 1024w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/tinymce-wysiwyg-html-editor-plugin-advanced-full-featured-codexworld-300x129.png 300w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/tinymce-wysiwyg-html-editor-plugin-advanced-full-featured-codexworld-768x331.png 768w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/tinymce-wysiwyg-html-editor-plugin-advanced-full-featured-codexworld-200x86.png 200w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/tinymce-wysiwyg-html-editor-plugin-advanced-full-featured-codexworld-346x149.png 346w, https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/tinymce-wysiwyg-html-editor-plugin-advanced-full-featured-codexworld.png 1215w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/div>\n<p class=\"seeAlso\"><span><\/span><a href=\"https:\/\/www.codexworld.com\/tinymce-upload-image-to-server-using-php\/\">Server-side Image Upload in TinyMCE Editor using PHP<\/a><\/p>\n<h2>Get TinyMCE Editor Content using PHP<\/h2>\n<p>Use <span style=\"color: rgb(186, 98, 54);\">&lt;<span style=\"color: rgb(186, 98, 54);\">form<\/span>&gt;<\/span> element to submit editor HTML content to the server-side script.<\/p>\n<ul class=\"bullet_disk_list\">\n<li>Add name attribute in <span style=\"color: rgb(186, 98, 54);\">&lt;<span style=\"color: rgb(186, 98, 54);\">textarea<\/span>&gt;<\/span> element to submit input value to PHP script.<\/li>\n<li>TinyMCE editor content will be submitted to the form action URL as HTML.<\/li>\n<\/ul>\n<pre style=\"color: rgb(95, 94, 78);\"><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">form<\/span> <span class=\"hljs-attr\">method<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"post\"<\/span> <span class=\"hljs-attr\">action<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"submit.php\"<\/span>&gt;<\/span>\r\n    <span class=\"hljs-comment\" style=\"color: rgb(108, 107, 90);\">&lt;!-- Editor input --&gt;<\/span>\r\n    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">textarea<\/span> <span class=\"hljs-attr\">id<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"myTextarea\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"editor_input\"<\/span>&gt;<\/span><span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">textarea<\/span>&gt;<\/span>\r\n\r\n    <span class=\"hljs-comment\" style=\"color: rgb(108, 107, 90);\">&lt;!-- Submit button --&gt;<\/span>\r\n    <span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">input<\/span> <span class=\"hljs-attr\">type<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"submit\"<\/span> <span class=\"hljs-attr\">name<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"submit\"<\/span> <span class=\"hljs-attr\">value<\/span>=<span class=\"hljs-string\" style=\"color: rgb(125, 151, 38);\">\"Submit\"<\/span>&gt;<\/span>\r\n<span class=\"hljs-tag\" style=\"color: rgb(186, 98, 54);\">&lt;\/<span class=\"hljs-name\" style=\"color: rgb(186, 98, 54);\">form<\/span>&gt;<\/span><\/pre>\n<p>In the server-side script (<code>submit.php<\/code>), you can get the HTML content from TinyMCE using the <b>$_POST method in PHP<\/b>.<\/p>\n<pre><span style=\"color: #0000BB\">&lt;?php <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;If&nbsp;the&nbsp;form&nbsp;is&nbsp;submitted <br \/><\/span><span style=\"color: #007700\">if(isset(<\/span><span style=\"color: #0000BB\">$_POST<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'submit'<\/span><span style=\"color: #007700\">])){ <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Get&nbsp;editor&nbsp;content <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #0000BB\">$editor_content&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$_POST<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #DD0000\">'editor_input'<\/span><span style=\"color: #007700\">]; <br \/> <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #FF8000\">\/\/&nbsp;Render&nbsp;editor&nbsp;HTML <br \/>&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #0000BB\">$editor_content<\/span><span style=\"color: #007700\">; <br \/>} <br \/> <br \/><\/span><span style=\"color: #0000BB\">?&gt;<\/span><\/pre>\n<p class=\"seeAlso\"><span><\/span><a href=\"https:\/\/www.codexworld.com\/save-html-editor-content-in-database-php-mysql\/\">Save WYSIWYG Editor Content in Database using PHP and MySQL<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The full form of WYSIWYG is What You See Is What You Get, it lets users see what the end result will look like when the document is printed. Basically, the WYSIWYG editor is driven <\/p>\n","protected":false},"author":1,"featured_media":5102,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[6],"tags":[179,16,14,170,183],"class_list":["post-1538","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jquery","tag-html","tag-jquery","tag-php","tag-text-editor","tag-tinymce","cat-6-id","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Add WYSIWYG HTML Editor to Textarea on Your Website - CodexWorld<\/title>\n<meta name=\"description\" content=\"TinyMCE WYSIWYG HTML Editor - Minimal code to add WYSIWYG HTML Editor to textarea using TinyMCE jQuery plugin and get HTML editor content in PHP.\" \/>\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.codexworld.com\/add-wysiwyg-html-editor-to-textarea-website\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Add WYSIWYG HTML Editor to Textarea on Your Website - CodexWorld\" \/>\n<meta property=\"og:description\" content=\"TinyMCE WYSIWYG HTML Editor - Minimal code to add WYSIWYG HTML Editor to textarea using TinyMCE jQuery plugin and get HTML editor content in PHP.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codexworld.com\/add-wysiwyg-html-editor-to-textarea-website\/\" \/>\n<meta property=\"og:site_name\" content=\"CodexWorld\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:published_time\" content=\"2016-05-19T18:59:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-10-18T05:46:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/add-wysiwyg-html-editor-to-textarea-on-website-codexworld.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1366\" \/>\n\t<meta property=\"og:image:height\" content=\"768\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CodexWorld\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codexworldblog\" \/>\n<meta name=\"twitter:site\" content=\"@codexworldweb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CodexWorld\" \/>\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.codexworld.com\\\/add-wysiwyg-html-editor-to-textarea-website\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-wysiwyg-html-editor-to-textarea-website\\\/\"},\"author\":{\"name\":\"CodexWorld\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\"},\"headline\":\"Add WYSIWYG HTML Editor to Textarea on Your Website\",\"datePublished\":\"2016-05-19T18:59:22+00:00\",\"dateModified\":\"2022-10-18T05:46:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-wysiwyg-html-editor-to-textarea-website\\\/\"},\"wordCount\":570,\"commentCount\":7,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-wysiwyg-html-editor-to-textarea-website\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2016\\\/05\\\/add-wysiwyg-html-editor-to-textarea-on-website-codexworld.png\",\"keywords\":[\"HTML\",\"jQuery\",\"PHP\",\"Text Editor\",\"TinyMCE\"],\"articleSection\":[\"jQuery\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/add-wysiwyg-html-editor-to-textarea-website\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-wysiwyg-html-editor-to-textarea-website\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/add-wysiwyg-html-editor-to-textarea-website\\\/\",\"name\":\"Add WYSIWYG HTML Editor to Textarea on Your Website - CodexWorld\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-wysiwyg-html-editor-to-textarea-website\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-wysiwyg-html-editor-to-textarea-website\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2016\\\/05\\\/add-wysiwyg-html-editor-to-textarea-on-website-codexworld.png\",\"datePublished\":\"2016-05-19T18:59:22+00:00\",\"dateModified\":\"2022-10-18T05:46:48+00:00\",\"description\":\"TinyMCE WYSIWYG HTML Editor - Minimal code to add WYSIWYG HTML Editor to textarea using TinyMCE jQuery plugin and get HTML editor content in PHP.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-wysiwyg-html-editor-to-textarea-website\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/add-wysiwyg-html-editor-to-textarea-website\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-wysiwyg-html-editor-to-textarea-website\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2016\\\/05\\\/add-wysiwyg-html-editor-to-textarea-on-website-codexworld.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2016\\\/05\\\/add-wysiwyg-html-editor-to-textarea-on-website-codexworld.png\",\"width\":1366,\"height\":768,\"caption\":\"add-wysiwyg-html-editor-to-textarea-on-website-codexworld\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/add-wysiwyg-html-editor-to-textarea-website\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codexworld.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Add WYSIWYG HTML Editor to Textarea on Your Website\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"name\":\"CodexWorld\",\"description\":\"Web &amp; Mobile App Development Company\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codexworld.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\",\"name\":\"CodexWorld\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"width\":200,\"height\":19,\"caption\":\"CodexWorld\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldweb\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/codexworld\",\"https:\\\/\\\/www.youtube.com\\\/codexworld\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\",\"name\":\"CodexWorld\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"caption\":\"CodexWorld\"},\"description\":\"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.\",\"sameAs\":[\"http:\\\/\\\/www.codexworld.com\",\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldblog\"],\"url\":\"https:\\\/\\\/www.codexworld.com\\\/author\\\/nitya192265\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Add WYSIWYG HTML Editor to Textarea on Your Website - CodexWorld","description":"TinyMCE WYSIWYG HTML Editor - Minimal code to add WYSIWYG HTML Editor to textarea using TinyMCE jQuery plugin and get HTML editor content in PHP.","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.codexworld.com\/add-wysiwyg-html-editor-to-textarea-website\/","og_locale":"en_US","og_type":"article","og_title":"Add WYSIWYG HTML Editor to Textarea on Your Website - CodexWorld","og_description":"TinyMCE WYSIWYG HTML Editor - Minimal code to add WYSIWYG HTML Editor to textarea using TinyMCE jQuery plugin and get HTML editor content in PHP.","og_url":"https:\/\/www.codexworld.com\/add-wysiwyg-html-editor-to-textarea-website\/","og_site_name":"CodexWorld","article_publisher":"https:\/\/www.facebook.com\/codexworld","article_author":"https:\/\/www.facebook.com\/codexworld","article_published_time":"2016-05-19T18:59:22+00:00","article_modified_time":"2022-10-18T05:46:48+00:00","og_image":[{"width":1366,"height":768,"url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/add-wysiwyg-html-editor-to-textarea-on-website-codexworld.png","type":"image\/png"}],"author":"CodexWorld","twitter_card":"summary_large_image","twitter_creator":"@codexworldblog","twitter_site":"@codexworldweb","twitter_misc":{"Written by":"CodexWorld","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codexworld.com\/add-wysiwyg-html-editor-to-textarea-website\/#article","isPartOf":{"@id":"https:\/\/www.codexworld.com\/add-wysiwyg-html-editor-to-textarea-website\/"},"author":{"name":"CodexWorld","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0"},"headline":"Add WYSIWYG HTML Editor to Textarea on Your Website","datePublished":"2016-05-19T18:59:22+00:00","dateModified":"2022-10-18T05:46:48+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codexworld.com\/add-wysiwyg-html-editor-to-textarea-website\/"},"wordCount":570,"commentCount":7,"publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"image":{"@id":"https:\/\/www.codexworld.com\/add-wysiwyg-html-editor-to-textarea-website\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/add-wysiwyg-html-editor-to-textarea-on-website-codexworld.png","keywords":["HTML","jQuery","PHP","Text Editor","TinyMCE"],"articleSection":["jQuery"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.codexworld.com\/add-wysiwyg-html-editor-to-textarea-website\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.codexworld.com\/add-wysiwyg-html-editor-to-textarea-website\/","url":"https:\/\/www.codexworld.com\/add-wysiwyg-html-editor-to-textarea-website\/","name":"Add WYSIWYG HTML Editor to Textarea on Your Website - CodexWorld","isPartOf":{"@id":"https:\/\/www.codexworld.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codexworld.com\/add-wysiwyg-html-editor-to-textarea-website\/#primaryimage"},"image":{"@id":"https:\/\/www.codexworld.com\/add-wysiwyg-html-editor-to-textarea-website\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/add-wysiwyg-html-editor-to-textarea-on-website-codexworld.png","datePublished":"2016-05-19T18:59:22+00:00","dateModified":"2022-10-18T05:46:48+00:00","description":"TinyMCE WYSIWYG HTML Editor - Minimal code to add WYSIWYG HTML Editor to textarea using TinyMCE jQuery plugin and get HTML editor content in PHP.","breadcrumb":{"@id":"https:\/\/www.codexworld.com\/add-wysiwyg-html-editor-to-textarea-website\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codexworld.com\/add-wysiwyg-html-editor-to-textarea-website\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/add-wysiwyg-html-editor-to-textarea-website\/#primaryimage","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/add-wysiwyg-html-editor-to-textarea-on-website-codexworld.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/add-wysiwyg-html-editor-to-textarea-on-website-codexworld.png","width":1366,"height":768,"caption":"add-wysiwyg-html-editor-to-textarea-on-website-codexworld"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codexworld.com\/add-wysiwyg-html-editor-to-textarea-website\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codexworld.com\/"},{"@type":"ListItem","position":2,"name":"Add WYSIWYG HTML Editor to Textarea on Your Website"}]},{"@type":"WebSite","@id":"https:\/\/www.codexworld.com\/#website","url":"https:\/\/www.codexworld.com\/","name":"CodexWorld","description":"Web &amp; Mobile App Development Company","publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codexworld.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codexworld.com\/#organization","name":"CodexWorld","url":"https:\/\/www.codexworld.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","width":200,"height":19,"caption":"CodexWorld"},"image":{"@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldweb","https:\/\/www.linkedin.com\/company\/codexworld","https:\/\/www.youtube.com\/codexworld"]},{"@type":"Person","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0","name":"CodexWorld","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","caption":"CodexWorld"},"description":"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.","sameAs":["http:\/\/www.codexworld.com","https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldblog"],"url":"https:\/\/www.codexworld.com\/author\/nitya192265\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/05\/add-wysiwyg-html-editor-to-textarea-on-website-codexworld.png","jetpack_shortlink":"https:\/\/wp.me\/p6bxIh-oO","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/1538","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/comments?post=1538"}],"version-history":[{"count":10,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/1538\/revisions"}],"predecessor-version":[{"id":5101,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/1538\/revisions\/5101"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media\/5102"}],"wp:attachment":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media?parent=1538"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/categories?post=1538"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/tags?post=1538"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}