<?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-get-title &#8211; Extreme Web Designs</title>
	<atom:link href="https://theextremewebdesigns.com/blog/tag/jquery-get-title/feed/" rel="self" type="application/rss+xml" />
	<link>https://theextremewebdesigns.com/blog</link>
	<description>Web Design and Web Development</description>
	<lastBuildDate>Fri, 20 Jul 2012 08:37:45 +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 Alert / Get DIV Title Examples</title>
		<link>https://theextremewebdesigns.com/blog/jquery-get-div-title-alert-div-title-using-jquery-2-ways/</link>
					<comments>https://theextremewebdesigns.com/blog/jquery-get-div-title-alert-div-title-using-jquery-2-ways/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 20 Jul 2012 08:37:45 +0000</pubDate>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[jquery-demos]]></category>
		<category><![CDATA[jquery-get-title]]></category>
		<category><![CDATA[jquery-tips]]></category>
		<guid isPermaLink="false">https://theextremewebdesigns.com/blog/?p=1059</guid>

					<description><![CDATA[If you ever wanted to alert Div title using jQuery but didn&#8217;t know how to do it, then you will find this article immensely helpful as I am going to share 2 ways to get div title using jQuery. By using jQuery, get title of any div or paragraph or any other element. Read on [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>If you ever wanted to alert Div title using jQuery but didn&#8217;t know how to do it, then you will find this article immensely helpful as I am going to share 2 ways to <em><strong>get div title using jQuery</strong></em>. By using jQuery, get title of any div or paragraph or any other element. Read on to find out more.<span id="more-1059"></span></p>
<h2>How to use jQuery to Get DIV Title / Alert DIV Title</h2>
<div class="make_demo">

	<form action="https://theextremewebdesigns.com/blog/wp-content/themes/ewd_blog_2017/try_demo.php?post_id=1059" 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>I am going to show you 2 ways to <em><strong>alert / get div title using jQuery</strong></em>. The difference in these two methods is minor and you will be able to understand them very easily. The differences exist primarily due to the version change in jQuery. I am going to show you how to do this by using an easy to follow example. Assume that we have a div with ID &#8220;my_div&#8221; and it has the title &#8220;My Div title&#8221;. Our aim is to get div title when &#8220;Show DIV title&#8221; button is clicked.</p>
<h3>Common HTML Source Code for the following examples:</h3>
<pre class="lang:xhtml decode:true">&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Alert DIV Title 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" class="my_class" title="My Div title"&gt;This is my div.&lt;/div&gt;

&lt;input type="submit" name="show_title" id="show_title" value="Show DIV title" /&gt;

&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>Example 1: How to get Div Title when jQuery version &lt; 1.6</h3>
<pre class="lang:js decode:true">&lt;script type="text/javascript"&gt;

$(document).ready(function() {

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

// Get / Alert Div Title when jQuery version &lt; 1.6
alert( $('#my_div').attr("title") );
});

});

&lt;/script&gt;</pre>
<h3>Example 2: How to get Div Title when jQuery version &gt; 1.6</h3>
<pre class="lang:js decode:true">&lt;script type="text/javascript"&gt;

$(document).ready(function() {

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

// Alert / Get Div Title when jQuery version &gt; 1.6
alert( $('#my_div').prop("title") );

});

});

&lt;/script&gt;</pre>
<p>So <strong>if you are using jQuery version &gt; 1.6, I strongly suggest you to go with Example 2</strong> shown above for best practices &amp; for better future compatibility .</p>
<div class="make_demo">

	<form action="https://theextremewebdesigns.com/blog/wp-content/themes/ewd_blog_2017/try_demo.php?post_id=1059" 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>Your turn!</h5>
<p>Do you know of any other ways to use <em><strong>jQuery to </strong><strong>alert / get Div title</strong></em>? Feel free to suggest by commenting below.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://theextremewebdesigns.com/blog/jquery-get-div-title-alert-div-title-using-jquery-2-ways/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1059</post-id>	</item>
	</channel>
</rss>
