Help us understand the problem. What is going on with this article?

アコーディオンパネル使い方

アコーディオンパネル

スクリーンショット 2020-10-23 9.09.30.png

html
<dl class="accordion">
    <dt>A</dt>
    <dd class="dda">ここにAの内容が入る</dd>
    <dt>B</dt>
    <dd class="ddb">ここにBの内容が入る</dd>
    <dt>C</dt>
    <dd class="ddc">ここにCの内容が入る</dd>
  </dl>
css
    .accordion{
      width: 500px;
      margin: 50px auto;
      text-align: center;
    }
      dt {
        padding: 16px;
        background: #2894f0;
        border: 2px solid #2894f0;
        color: #ffffff;
        font-size: 24px;
      }
      dd {
        height: 100px;
        padding: 16px;
        border: 2px solid #2894f0;
        border-top: 0;
      }
js
$(function() {
      $('dd').hide();
      $('dt').on('click',function() {
        $('.dda').slideDown(400);
      });
    });
kyototea
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away