<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>iww</author_name>
  <author_url>https://blog.hatena.ne.jp/iww/</author_url>
  <blog_title>揮発性のメモ２</blog_title>
  <blog_url>https://iww.hateblo.jp/</blog_url>
  <categories>
    <anon>JavaScript</anon>
  </categories>
  <description>api.jquery.com第1引数にクラス名のみを書くと、そのクラスを交互につけたり外したりする。 第1引数にクラス名、第2引数に真偽値を書くと、真のときはクラスをつけて、偽のときにはクラスを外す。 $(&quot;#hoge&quot;).toggleClass(&quot;hoge_red&quot;, true); // 真なので クラスをつける $(&quot;#hoge&quot;).toggleClass(&quot;hoge_red&quot;, false); // 偽なので クラスを外す $(&quot;#hoge&quot;).toggleClass(&quot;hoge_red&quot;, 0); // boolではないのでトグル動作する（この場合、つける） $(&quot;#hoge&quot;).to…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fiww.hateblo.jp%2Fentry%2F20240913%2FtoggleClass&quot; title=&quot;jQueryで、 toggleClassを使ってクラスをつけたり外したりする - 揮発性のメモ２&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn.user.blog.st-hatena.com/default_entry_og_image/42132/1685946694840016</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2024-09-13 00:00:00</published>
  <title>jQueryで、 toggleClassを使ってクラスをつけたり外したりする</title>
  <type>rich</type>
  <url>https://iww.hateblo.jp/entry/20240913/toggleClass</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
