<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>セレクタ on qwerty.work</title>
        <link>https://qwerty.work/tags/%E3%82%BB%E3%83%AC%E3%82%AF%E3%82%BF/</link>
        <description>Recent content in セレクタ on qwerty.work</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>ja-JP</language>
        <lastBuildDate>Tue, 27 Sep 2022 09:58:37 +0900</lastBuildDate><atom:link href="https://qwerty.work/tags/%E3%82%BB%E3%83%AC%E3%82%AF%E3%82%BF/index.xml" rel="self" type="application/rss+xml" /><item>
            <title>【jQuery】セレクタで指定した要素から他の要素を辿るメソッドの一覧 </title>
            <link>https://qwerty.work/post/2022/09/jquery-selector-method/</link>
            <pubDate>Tue, 27 Sep 2022 09:58:37 +0900</pubDate>
            <guid>https://qwerty.work/post/2022/09/jquery-selector-method/</guid>
            <description>&lt;h2 id=&#34;メソッド一覧&#34;&gt;メソッド一覧&#xA;&lt;/h2&gt;&lt;p&gt;指定した要素から親要素、子要素、兄弟要素を探したり、要素を検索したりする場合に使います。&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code&gt;  コード&#xA;  選択される要素&#xA;&#xA;&#xA;&#xA;&#xA;  $(&#39;#box&#39;).parent()&#xA;  id=&amp;quot;box&amp;quot;の直接の親要素&#xA;&#xA;&#xA;  $(&#39;#box&#39;).children() &#xA;  id=&amp;quot;box&amp;quot;直下の子要素&#xA;&#xA;&#xA;  $(&#39;#box&#39;).find(&#39;a&#39;)&#xA;  id=&amp;quot;box&amp;quot;の子を辿って見つかったすべてのa&#xA;&#xA;&#xA;  $(&#39;#box&#39;).closest(&#39;div&#39;)&#xA;  id=&amp;quot;box&amp;quot;の親を辿って最初に見つかったdiv&#xA;&#xA;&#xA;  $(&#39;#box&#39;).next()&#xA;  id=&amp;quot;box&amp;quot;と同じ階層にある次の要素&#xA;&#xA;&#xA;  $(&#39;#box&#39;).prev()&#xA;  id=&amp;quot;box&amp;quot;と同じ階層にある1つ前の要素&#xA;&#xA;&#xA;  $(&#39;#box&#39;).siblings(&#39;.item&#39;)&#xA;  id=&amp;quot;box&amp;quot;と同じ階層でitemクラスを持つすべての要素&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;その他参考&#34;&gt;その他参考&#xA;&lt;/h2&gt;&lt;p&gt;フィルタリングなど、他にももっと便利なメソッドがあり、以下のページが参考になります。&lt;/p&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://www.jquerystudy.info/reference/traversing/index.html&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://www.jquerystudy.info/reference/traversing/index.html&#34; alt=&#34;https://www.jquerystudy.info/reference/traversing/index.html&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://www.jquerystudy.info/reference/traversing/index.html&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://www.jquerystudy.info/reference/traversing/index.html&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;&#xA;  &#xA;&#xA;&#xA;&lt;div class=&#34;link-card&#34;&gt;&#xA;  &lt;a href=&#34;https://api.jquery.com/category/traversing/&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-image&#34;&gt;&#xA;      &lt;img src=&#34;https://image.thum.io/get/width/300/crop/200/https://api.jquery.com/category/traversing/&#34; alt=&#34;https://api.jquery.com/category/traversing/&#34; loading=&#34;lazy&#34;&gt;&#xA;    &lt;/div&gt;&#xA;    &#xA;    &lt;div class=&#34;link-card-body&#34;&gt;&#xA;      &lt;span class=&#34;link-card-title&#34;&gt;https://api.jquery.com/category/traversing/&lt;/span&gt;&#xA;      &#xA;      &lt;span class=&#34;link-card-url&#34;&gt;https://api.jquery.com/category/traversing/&lt;/span&gt;&#xA;    &lt;/div&gt;&#xA;  &lt;/a&gt;&#xA;&lt;/div&gt;&#xA;&#xA;</description>
        </item></channel>
</rss>
