101일: 3-4차 프론트 작업

Jiwontwopunch·2022년 4월 12일
0

국비기록

목록 보기
101/121
post-thumbnail

2022.04.12.Tue.

✅ 3-4차 프론트 작업

✅ 테이블 동적 동작

<body>
  <table border="1">
    <th>이미지</th>
    <th class="title">제목</th>
    <th style="display: none;"></th>
    <th>작성자</th>
<tr>
      <td>zz</td>
      <td>tt</td>
      <td>yy</td>
      <tr>
      <td class="none show" colspan="3">zzzzzz</td>
    </tr>
  </tr>
  </table>

  <script>
    let show= document.querySelector(".show");
    let title = document.querySelector(".title");
    title.addEventListener('click',()=>{
      if(show.style.display==='none'){
        show.style.display="";
      }else {
        show.style.display='none';
      }
    }) 
  </script>
</body>

0개의 댓글