如何将类添加到奇数类"recensie"中?在类"album_revieuws"中 [英] How to add class to odd class "recensie" within section with class 'album_revieuws'

查看:82
本文介绍了如何将类添加到奇数类"recensie"中?在类"album_revieuws"中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有这个问题.

我想知道如何添加选择的"课程 到该部分中仅具有Album_reviews类的每个称为recensie的奇怪类.

I am wondering how i can add an class "selected" to every odd class called recensie within the section with the class album_reviews only.

<section class="album_reviews">
    <h2 class="sectiontitel"> Album Reviews </h2>
    <article class="recensie">
      <h1> Neil Young – A Letter Home </h1>
      <img src="Images/Albums/A_Letter_Home.jpg" alt="album_image"/>
      <p>Earlier this year, Neil Young unveiled Pono, a super-high-def audio service meant to deliver us from the sonic crimes of the earbud era. For his next act, he's released an acoustic covers set recorded at Jack White's Nashville music shop on a Voice-O-Graph--a super-low-def 1940s contraption that looks like a phone booth and sounds a few steps removed from a rusty tin can and some twine. If it's meant as some kind of joke, here's the punch line: In its perverse way, A Letter Home is one of the most enjoyable records Young has made this century.</p>
      <p> 
        <a href="http://www.rollingstone.com/music/albumreviews/a-letter-home-20140502#ixzz33g0Hq3pw"> Read more </a>
      </p>       
    </article>
  </section>

  <section class="band_members">
    <h2 class="sectiontitel"> Band Members</h2>
    <article class="recensie">
      <h1> Neil Young </h1>
      <figure>
          <img src="Images/Artists/Neil_Young.jpg" alt="Macaque in the trees">
          <figcaption> Neil Young <br /> Singer Songwriter </figcaption>
      </figure>
    </article>
  </section>

那是我的HTML代码. 我知道如何在本节中仅向赔率添加类,而不仅向赔率添加类.album_reviews

That's my HTML code. I know how to add a class to only the odd's but not to only the odds within the section.album_reviews

希望有人可以提供帮助

推荐答案

$('.album_reviews').find('.recensie:odd').addClass('selected');

这篇关于如何将类添加到奇数类"recensie"中?在类"album_revieuws"中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆