<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>jquery-replace-innerhtml &#8211; Extreme Web Designs</title>
	<atom:link href="https://theextremewebdesigns.com/blog/tag/jquery-replace-innerhtml/feed/" rel="self" type="application/rss+xml" />
	<link>https://theextremewebdesigns.com/blog</link>
	<description>Web Design and Web Development</description>
	<lastBuildDate>Thu, 21 Jun 2012 09:39:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.5</generator>
<site xmlns="com-wordpress:feed-additions:1">156673191</site>	<item>
		<title>jQuery innerHTML Examples</title>
		<link>https://theextremewebdesigns.com/blog/jquery-innerhtml-jquery-replace-innerhtml-of-div-examples/</link>
					<comments>https://theextremewebdesigns.com/blog/jquery-innerhtml-jquery-replace-innerhtml-of-div-examples/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Thu, 21 Jun 2012 09:39:56 +0000</pubDate>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[jquery-demos]]></category>
		<category><![CDATA[jquery-innerhtml]]></category>
		<category><![CDATA[jquery-replace-innerhtml]]></category>
		<category><![CDATA[jquery-tips]]></category>
		<guid isPermaLink="false">https://theextremewebdesigns.com/blog/?p=952</guid>

					<description><![CDATA[If you have heard about jQuery innerHTML, then at some point of time or other, you must have wondered how to use jQuery to replace innerHTML of Div. In this article, I am going to share some examples on how to do just that. Examples for using  jQuery to Replace innerHTML of Div Here is an [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>If you have heard about <strong>jQuery innerHTML</strong>, then at some point of time or other, you must have wondered how to use <em><strong>jQuery to replace innerHTML of Div</strong></em>. In this article, I am going to share some examples on how to do just that.<span id="more-952"></span></p>
<h2>Examples for using  jQuery to Replace innerHTML of Div</h2>
<div class="make_demo">

	<form action="https://theextremewebdesigns.com/blog/wp-content/themes/ewd_blog_2017/try_demo.php?post_id=952" method="post" name="form1" target="_blank" id="form1">


	<input type="hidden" name="shortcode_content" id="shortcode_content" value="" />

        <div class="try_demo_btn_container">


            <button type="submit" name="sbt_make_demo" id="sbt_make_demo" class="btn-primary btn-try-demo">
                Try Demo
            </button>


        </div><!-- .try_demo_btn_container -->

    </form>
    </div>
    
<p>Here is an example with complete source code that shows <em><strong>how to use jQuery to replace innerHTML of Div</strong></em>. The example assumes that there is a div with ID &#8220;my_div&#8221; with some default content and this content will need to be replaced with other text. Similarly, the content of the div with class &#8220;my_div2&#8221; gets replaced with replacement text.  All this happens when a button is clicked.</p>
<p><strong>Example: Here is the complete source code to replace innerHTML of div using jQuery</strong></p>
<pre class="lang:xhtml decode:true">&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Replace innerHTML of Div using jQuery&lt;/title&gt;
&lt;script type="text/javascript" src="js/jquery-1.8.2.min.js"&gt;&lt;/script&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;div id="my_div"&gt;Default content&lt;/div&gt;

&lt;div class="my_div2"&gt;Default content 2&lt;/div&gt;

&lt;input type="submit" name="replace" id="replace" value="Replace" /&gt;

&lt;script type="text/javascript" language="javascript" &gt;

$('#replace').click(function() {

	//Using ID
	$("#my_div").html("This is replacement text.");

	//Using Class
	$(".my_div2").html("This is replacement text 2.");

});

&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;</pre>
<p>When you run the above code, simply click on the button and you will see that the default text &#8220;Default content&#8221; is changed to &#8220;This is replacement text.&#8221;. Similarly, the default text &#8220;Default content 2&#8221; is changed to &#8220;This is replacement text 2.&#8221;</p>
<div class="make_demo">

	<form action="https://theextremewebdesigns.com/blog/wp-content/themes/ewd_blog_2017/try_demo.php?post_id=952" method="post" name="form1" target="_blank" id="form1">


	<input type="hidden" name="shortcode_content" id="shortcode_content" value="" />

        <div class="try_demo_btn_container">


            <button type="submit" name="sbt_make_demo" id="sbt_make_demo" class="btn-primary btn-try-demo">
                Try Demo
            </button>


        </div><!-- .try_demo_btn_container -->

    </form>
    </div>
    
<h5>Simple, isn&#8217;t it?</h5>
<p>Do you know of any other ways to <em><strong>replace innerHTML of Div using jQuery</strong></em>? Feel free to suggest by commenting below.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://theextremewebdesigns.com/blog/jquery-innerhtml-jquery-replace-innerhtml-of-div-examples/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">952</post-id>	</item>
	</channel>
</rss>
