<?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>Pamaya - Web Design &#38; Development North Wales - Software Development, Graphic Design and Branding &#187; 1.3</title>
	<atom:link href="http://www.pamaya.com/tags/13/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pamaya.com</link>
	<description>Web Design and Development North Wales</description>
	<lastBuildDate>Wed, 30 Mar 2011 14:45:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to select elements from inside jQuery objects</title>
		<link>http://www.pamaya.com/how-to-select-elements-from-inside-jquery-objects/</link>
		<comments>http://www.pamaya.com/how-to-select-elements-from-inside-jquery-objects/#comments</comments>
		<pubDate>Thu, 16 Apr 2009 10:03:26 +0000</pubDate>
		<dc:creator>Maja Williams</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Blogs]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[1.3]]></category>
		<category><![CDATA[DOM]]></category>

		<guid isPermaLink="false">http://www.pamaya.com/?p=364</guid>
		<description><![CDATA[I just came across a very interesting question in the jQuery Google group asking about how to select elements that are inside of a jQuery object. After posting my response there I thought I would follow it up with a new jQuery article.]]></description>
			<content:encoded><![CDATA[<p>I just came across a very interesting question in the jQuery Google group asking about how to select elements that are inside of a jQuery object. After posting my response there I thought I would follow it up with a new jQuery article.</p>
<p>Say for example we wanted to select the following block of XHTML:</p>
<pre name="code" class="html">
<div id="main">
<div class="odd">Hello</div>
<div class="even">blank</div>
<div class="odd">Hello</div>
</div>
</pre>
<p>We would use jQuery to select this code black as follows with a bit of JavaScript:</p>
<pre name="code" class="javascript">
(function ($) {
    $().ready ( function () {
        var main = $('#main');
    });
})(jQuery);
</pre>
<p>So when the above snippet runs it would select the element with the id of &#8220;main&#8221; in this case it&#8217;s the main div element. So then to further drill down to be able to select elements within this jQuery object we would extend the previous snippet to the following:</p>
<pre name="code" class="javascript">
(function ($) {
	$().ready ( function () {
		var main = $('#main');
		main.each ( function () {
			var odds = $(this).find ('.odd');
			odds.each ( function () {
				$(this).append ('
<div>World</div>
<div></div>

');
			});
		});
	});
})(jQuery);
</pre>
<p>Doing this will select all of the elements with the class &#8220;odd&#8221; and append two div&#8217;s to it. Obviously you could just select all of the &#8220;odd&#8221; elements in this document and get the same result but if you where working with multiple tables with the same class names and you only wanted to manipulate one this would be a useful technique.</p>
<p>Hope this helps. For further information about selectors please read my article <a  title=" jQuery selectors and attribute selectors reference and examples" href="http://www.pamaya.com/jquery-selectors-and-attribute-selectors-reference-and-examples/">jQuery selectors and attribute selectors reference and examples</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pamaya.com/how-to-select-elements-from-inside-jquery-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

