<button id="summonBtn">幻影を召喚</button>
<div id="stage"></div>
.phantom {
display: inline-block;
padding: 10px 20px;
background: purple;
color: white;
margin: 5px;
border-radius: 8px;
}
const btn = document.querySelector('#summonBtn');
const stage = document.querySelector('#stage');
btn.addEventListener('click', function() {
const phantom = document.createElement('div');
phantom.textContent = '👻 幻影';
phantom.classList.add('phantom');
stage.appendChild(phantom);
setTimeout(function() {
phantom.remove();
}, 2000);
});