<div class="box">
      <div class="wrapper">
        <img src="//www.w3cplus.com/sites/default/files/blogs/2017/1709/meinv-1.jpg" alt="美女与野獸" width="400" class="figure" />
    </div>
    <div class="action">
        <button id="btn">美女与野獸</button>
    </div>
</div>
$white: #f1e4f3;
$button: #f686bd;

body {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center
}
.wrapper {
  border: 1px solid #ccc;
  padding: 3px;
  border-radius: 3px;
  box-shadow: 0 0 3px lighten(#ccc, 0.15);
  margin-bottom: 15px;
  
  img {
    vertical-align: top;
  }
}

button {
  border: none 0;
  padding: 10px 20px;
  border-radius: 3px;
  background: $button;
  color: $white;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-block;
  cursor: pointer;
  
  &:hover {
    background: darken($button, 5%);
  }
}
View Compiled
let data = {
  imgInfo: {
    imgUrl: '//www.w3cplus.com/sites/default/files/blogs/2017/1709/yuesou.jpg',
    alt: '野獸'
  }
}

const imgEle = document.querySelector('.figure')
const btn = document.getElementById('btn')

btn.addEventListener('click', () => {
    imgEle.setAttribute('src', data.imgInfo.imgUrl)
    imgEle.setAttribute('alt', data.imgInfo.alt)  
}, false)

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.