figure').forEach(item => {
          item.classList.remove('active')
        })
        let curImg = document.querySelector(`.iphone-images .${e.target.id}`)
        curImg.classList.add('active')
        // 给图片的父元素增加自定义属性值
        document.querySelector(`.iphone-images`).dataset.active = e.target.id
      }
    })
  </script>
</body>

</html>