JSFiddle - React, Tailwind, and code Playground

by Valentin Sarychev

HTML

<div id="x">
  <a href='#1'>#1</a>
</div>

CSS

a {
  display: block;
  width: 50px;
  height: 50px;
  background: #f00;
  color: #fff;
  padding: 10px;
  border: 1px solid #000;
}

JavaScript

document.querySelector('#x').addEventListener('mouseenter', () => {
  for (let i = 0; i < 90000; ++i) {
    sessionStorage.x = i;
  }
  
  const a = document.createElement('a');
  a.href = '#2';
  a.text = '#2'
  a.addEventListener('click', () => alert('#2'));
  document.querySelector('#x').prepend(a);
});