{"id":1043,"date":"2012-07-14T14:23:40","date_gmt":"2012-07-14T14:23:40","guid":{"rendered":"https:\/\/theextremewebdesigns.com\/blog\/?p=1043"},"modified":"2012-07-14T14:23:40","modified_gmt":"2012-07-14T14:23:40","slug":"jquery-replace-dot-replace-dot-or-period-using-jquery","status":"publish","type":"post","link":"https:\/\/theextremewebdesigns.com\/blog\/jquery-replace-dot-replace-dot-or-period-using-jquery\/","title":{"rendered":"jQuery Replace Dot Or Period Examples"},"content":{"rendered":"<p>Ever wanted to replace Dot or Period using jQuery? In this article, I am going to show you how to easily <em><strong>replace a dot or a period with any other character using jQuery<\/strong><\/em>.<!--more--><\/p>\n<h2>Examples on using jQuery to Replace Dot<\/h2>\n<p>Let&#8217;s assume that you have a div with ID &#8220;my_div&#8221; and you would like the <strong><em>dot to be replaced by another character using jQuery<\/em><\/strong> and assign the new text back to the same div. Here&#8217;s how you can do it.<\/p>\n<h3>Example 1: Replace all Dots \/ Periods\u00a0in a Div with Space using jQuery:<\/h3>\n<pre class=\"lang:js decode:true\">$(document).ready(function() {\nvar str = $(\"#my_div\").html().replace(\/\\.\/g, ' ');\n$(\"#my_div\").html(str);\n});<\/pre>\n<h3>Example 2:\u00a0Replace all Dots \/ Periods\u00a0in a Div with Dash using jQuery:<\/h3>\n<pre class=\"lang:js decode:true\">$(document).ready(function() {\nvar str = $(\"#my_div\").html().replace(\/\\.\/g, '-');\n$(\"#my_div\").html(str);\n});<\/pre>\n<h3>Example 3:\u00a0Replace all Dots \/ Periods\u00a0in a Div with multiple dashes using jQuery:<\/h3>\n<pre class=\"lang:js decode:true\">$(document).ready(function() {\nvar str = $(\"#my_div\").html().replace(\/\\.\/g, '---');\n$(\"#my_div\").html(str);\n});<\/pre>\n<h3>Example 4:\u00a0Remove all Dots \/ Periods in a Div using jQuery:<\/h3>\n<pre class=\"lang:js decode:true\">$(document).ready(function() {\nvar str = $(\"#my_div\").html().replace(\/\\.\/g, '');\n$(\"#my_div\").html(str);\n});<\/pre>\n<h3>Example 5:\u00a0Remove all Dots \/ Periods in the entire body of the HTML page using jQuery:<\/h3>\n<pre class=\"lang:js decode:true\">$(document).ready(function() {\nvar str = $(\"body\").html().replace(\/\\.\/g, '');\n$(\"body\").html(str);\n});<\/pre>\n<h5>That&#8217;s it!<\/h5>\n<p>Do you know of any other ways to <em><strong>use jQuery to replace dot \/ period<\/strong><\/em>? Feel free to suggest by commenting below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ever wanted to replace Dot or Period using jQuery? In this article, I am going to show you how to easily replace a dot or a period with any other character using jQuery.<\/p>\n","protected":false},"author":1,"featured_media":395,"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":[20,13],"tags":[101,41],"class_list":["post-1043","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-jquery-tips-and-tricks","category-tips-and-tricks","tag-jquery-replace-dot-period","tag-jquery-tips"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/paBnQX-gP","jetpack_sharing_enabled":true,"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts\/1043","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=1043"}],"version-history":[{"count":0,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/posts\/1043\/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=1043"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/categories?post=1043"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/theextremewebdesigns.com\/blog\/wp-json\/wp\/v2\/tags?post=1043"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}