{"id":482,"date":"2012-03-27T06:27:26","date_gmt":"2012-03-27T06:27:26","guid":{"rendered":"https:\/\/theextremewebdesigns.com\/blog\/?p=482"},"modified":"2012-03-27T06:27:26","modified_gmt":"2012-03-27T06:27:26","slug":"apply-tinymce-specific-textarea","status":"publish","type":"post","link":"https:\/\/theextremewebdesigns.com\/blog\/apply-tinymce-specific-textarea\/","title":{"rendered":"Apply TinyMCE to specific textarea"},"content":{"rendered":"<p>In this article, I am going to show you 2 ways to <strong>apply TinyMCE to specific textarea<\/strong> on your web page.<!--more--><\/p>\n<h2>Apply TinyMCE to textarea (in general):<\/h2>\n<pre class=\"lang:xhtml decode:true\">\/\/HTML:\n&lt;textarea name=\"article_text\" cols=\"50\" rows=\"15\" id=\"article_text\"&gt;&lt;\/textarea&gt;\n&lt;textarea name=\"article_content\" cols=\"50\" rows=\"15\" id=\"article_content\"&gt;&lt;\/textarea&gt;\n&lt;textarea name=\"article_ref\" cols=\"50\" rows=\"15\" id=\"article_ref\"&gt;&lt;\/textarea&gt;\n\n\/\/JavaScript:\n&lt;script type=\"text\/javascript\"&gt;\ntinyMCE.init({\nmode : \"textareas\"\n});\n&lt;\/script&gt;<\/pre>\n<h2>Apply TinyMCE specific textarea using\u00a0Way 1:<\/h2>\n<p>You can <strong>apply TinyMCE to specific textarea(s)\u00a0\u00a0using their &#8220;ID&#8221;<\/strong>.<\/p>\n<pre class=\"lang:xhtml decode:true\">\/\/HTML:\n&lt;textarea name=\"article_text\" cols=\"50\" rows=\"15\" id=\"article_text\"&gt;&lt;\/textarea&gt;\n&lt;textarea name=\"article_content\" cols=\"50\" rows=\"15\" id=\"article_content\"&gt;&lt;\/textarea&gt;\n&lt;textarea name=\"article_ref\" cols=\"50\" rows=\"15\" id=\"article_ref\"&gt;&lt;\/textarea&gt;\n\n\/\/JavaScript:\n&lt;script type=\"text\/javascript\"&gt;\ntinyMCE.init({\nmode : \"exact\",\nelements : \"article_text, article_content\" \/\/ Simply enter comma seprated IDs of your textarea for which you want to add TinyMCE\n});\n&lt;\/script&gt;<\/pre>\n<h2>Apply TinyMCE specific textarea using\u00a0Way 2:<\/h2>\n<p>You can\u00a0<strong>apply TinyMCE to\u00a0specific textarea(s)\u00a0\u00a0using their &#8220;class&#8221;<\/strong>.<\/p>\n<pre class=\"lang:xhtml decode:true\">\/\/HTML:\n&lt;textarea name=\"article_text\" cols=\"50\" rows=\"15\" id=\"article_text\" class=\"my_editor\"&gt;&lt;\/textarea&gt;\n&lt;textarea name=\"article_content\" cols=\"50\" rows=\"15\" id=\"article_content\" class=\"my_editor2\"&gt;&lt;\/textarea&gt;\n&lt;textarea name=\"article_ref\" cols=\"50\" rows=\"15\" id=\"article_ref\" class=\"not_my_editor\"&gt;&lt;\/textarea&gt;\n\n\/\/JavaScript:\n&lt;script type=\"text\/javascript\"&gt;\ntinyMCE.init({\nmode : \"specific_textareas\",\neditor_selector : \"my_editor, my_editor2\", \/\/ Simply enter comma seprated class of your textarea for which you want to add TinyMCE\n});\n&lt;\/script&gt;<\/pre>\n<h5>That&#8217;s it!<\/h5>\n<p>Do you know of any other ways to <strong>apply TinyMCE to specific textarea<\/strong> ? If so, please share with us by commenting below.<\/p>\n<pre><strong> <\/strong><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In this article, I am going to show you 2 ways to apply TinyMCE to specific textarea on your web page.<\/p>\n","protected":false},"author":1,"featured_media":114,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[21],"tags":[66,67],"class_list":["post-482","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles","tag-tinymce","tag-wordpress-3"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/paBnQX-7M","jetpack_sharing_enabled":true,"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts\/482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/comments?post=482"}],"version-history":[{"count":0,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts\/482\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/media?parent=482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/categories?post=482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/tags?post=482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}