freeCodeCamp/curriculum/challenges/chinese/03-front-end-libraries/bootstrap/create-a-class-to-target-wi...

1.5 KiB

id title challengeType videoUrl localeTitle
bad87fee1348bd9aec908852 Create a Class to Target with jQuery Selectors 0 使用jQuery选择器创建一个目标类

Description

并非每个类都需要具有相应的CSS。有时我们创建类只是为了使用jQuery更容易地选择这些元素。为每个button元素提供类target

Instructions

Tests

tests:
  - text: 将<code>target</code>类应用于每个<code>button</code>元素。
    testString: 'assert($(".target").length > 5, "Apply the <code>target</code> class to each of your <code>button</code> elements.");'

Challenge Seed

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <div class="well">
        <button class="btn btn-default"></button>
        <button class="btn btn-default"></button>
        <button class="btn btn-default"></button>
      </div>
    </div>
    <div class="col-xs-6">
      <div class="well">
        <button class="btn btn-default"></button>
        <button class="btn btn-default"></button>
        <button class="btn btn-default"></button>
      </div>
    </div>
  </div>
</div>

Solution

// solution required