<?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>Как использовать PHP, JavaScript, jQuery &#187; селекторы jQuery</title>
	<atom:link href="http://firs.org.ua/tag/%d1%81%d0%b5%d0%bb%d0%b5%d0%ba%d1%82%d0%be%d1%80%d1%8b-jquery/feed/" rel="self" type="application/rss+xml" />
	<link>http://firs.org.ua</link>
	<description>Примеры кода PHP, JavaScript и jQuery</description>
	<lastBuildDate>Sat, 05 May 2012 08:25:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>jQuery селекторы &#8212; Базовые селекторы jQuery</title>
		<link>http://firs.org.ua/jquery/jquery-%d1%81%d0%b5%d0%bb%d0%b5%d0%ba%d1%82%d0%be%d1%80%d1%8b-%d0%b1%d0%b0%d0%b7%d0%be%d0%b2%d1%8b%d0%b5-%d1%81%d0%b5%d0%bb%d0%b5%d0%ba%d1%82%d0%be%d1%80%d1%8b-jquery/</link>
		<comments>http://firs.org.ua/jquery/jquery-%d1%81%d0%b5%d0%bb%d0%b5%d0%ba%d1%82%d0%be%d1%80%d1%8b-%d0%b1%d0%b0%d0%b7%d0%be%d0%b2%d1%8b%d0%b5-%d1%81%d0%b5%d0%bb%d0%b5%d0%ba%d1%82%d0%be%d1%80%d1%8b-jquery/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 20:43:28 +0000</pubDate>
		<dc:creator>Фирс Юрий</dc:creator>
				<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[примеры]]></category>
		<category><![CDATA[селекторы jQuery]]></category>
		<category><![CDATA[уроки]]></category>

		<guid isPermaLink="false">http://firs.org.ua/?p=42</guid>
		<description><![CDATA[Давайте рассмотрим базовые селекторы jQuery! Первый селектор jQuery all(). Ищет все элементы страницы (даже html, head, body) //jQuery Code $(&#34;*&#34;).css(&#34;border&#34;,&#34;3px solid red&#34;); //jQuery Code Пример jQuery &#8212; дает рамку всем элементам страницы. Селектор class(class). Выбирает все элементы заданного класса. Возвращает массив элементов. //jQuery Code $(&#34;.myClass&#34;).css(&#34;border&#34;,&#34;3px solid red&#34;); //jQuery Code В примере элементы указанного класса с помощью jQuery [...]]]></description>
			<content:encoded><![CDATA[<p>Давайте рассмотрим <strong>базовые селекторы jQuery</strong>!</p>
<p>Первый <strong>селектор jQuery all()</strong>.</p>
<p>Ищет все элементы страницы (даже html, head, body)<span id="more-42"></span></p>
<pre class="brush: javascript">

//jQuery Code

$(&quot;*&quot;).css(&quot;border&quot;,&quot;3px solid red&quot;);

//jQuery Code
</pre>
<p><a href="http://firs.org.ua/examples/jquery/jquery_selector_all.html">Пример jQuery</a> &#8212; дает рамку всем элементам страницы.</p>
<p>Селектор <strong>class(class).</strong></p>
<p>Выбирает все элементы заданного класса. Возвращает массив элементов.</p>
<pre class="brush: javascript">

//jQuery Code

$(&quot;.myClass&quot;).css(&quot;border&quot;,&quot;3px solid red&quot;);

//jQuery Code
</pre>
<p>В <a href="http://firs.org.ua/examples/jquery/jquery_selector_class.html">примере</a> элементы указанного класса с помощью jQuery обретают красную рамку.</p>
<p><strong>Селектор Jquery element(element)</strong></p>
<p>Этот селектор выбирает все элементы страницы с тегом, который указан. При этом class и id элемента не играет для <strong>jQuery</strong> роли.</p>
<pre class="brush: javascript">

//jQuery Code

$(&quot;div&quot;).css(&quot;border&quot;,&quot;3px solid red&quot;);

//jQuery Code
</pre>
<p>В следующем <a href="http://firs.org.ua/examples/jquery/jquery_selector_element.html">примере jQuery</a> у всех тегах div появляется красная рамка, у других элементах ее нету.</p>
<p>Если <strong>jQuery</strong> может выбирать элементы по классам, то также она может выбирать и элемент по идентификатору (id).<br />
Возвращает массив, хотя правильней будет сказать не массив, а один элемент, т.к. идентификатор по правилам присваивается только один раз одному элементу.</p>
<p>//jQuery Code</p>
<p>$(&#171;#myDiv&#187;).css(&#171;border&#187;,&#187;3px solid red&#187;);</p>
<p>//jQuery Code</p>
<p>[/sourcecode]</p>
<p>В <a href="http://firs.org.ua/examples/jquery/jquery_selector_id.html">этом</a> <strong>примере jQuery</strong> возвращает элемент с идентификатором myDiv.</p>
<pre class="brush: javascript">

//jQuery Code

$(&quot;#myID\\.entry\\[1\\]&quot;).css(&quot;border&quot;,&quot;3px solid red&quot;);

//jQuery Code
</pre>
<p>Также <strong>jQuery</strong> может элементы с идентификаторами которые содержат специальные символы, их нужно экранировать. Обратите внимание на этот <a href="http://firs.org.ua/examples/jquery/jquery_selector_id1.html">пример</a>.</p>
<p>Синтаксис селекторов основан на CSS, соответственно можно выбирать с помощью <strong>jQuery</strong> сразу по нескольким тегам, классам или идентификаторам.</p>
<pre class="brush: javascript">

//jQuery Code

$(&quot;div,span,p.myClass&quot;).css(&quot;border&quot;,&quot;3px solid red&quot;);

//jQuery Code
</pre>
<p><a href="http://firs.org.ua/examples/jquery/jquery_selector_multiple.html">Пример</a> показывает выбор по нескольким параметрам.</p>
<pre class="brush: javascript">

//jQuery Code

var list = $(&quot;div,p,span&quot;).map(function () {
return this.tagName;
}).get().join(&quot;, &quot;);
$(&quot;b&quot;).append(document.createTextNode(list));

//jQuery Code
</pre>
<p>А в этом <a href="http://firs.org.ua/examples/jquery/jquery_selector_multiple1.html">примере jQuery</a> показывается порядок элементов страницы с jQuery.</p>
]]></content:encoded>
			<wfw:commentRss>http://firs.org.ua/jquery/jquery-%d1%81%d0%b5%d0%bb%d0%b5%d0%ba%d1%82%d0%be%d1%80%d1%8b-%d0%b1%d0%b0%d0%b7%d0%be%d0%b2%d1%8b%d0%b5-%d1%81%d0%b5%d0%bb%d0%b5%d0%ba%d1%82%d0%be%d1%80%d1%8b-jquery/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

