[X]

The Konami Code

browser tricks 2000 still works

Up up down down left right left right B A, and the page does something silly.

In 2026: Works unchanged, and it is still a rite of passage. A keydown listener matches the key sequence from Konami's 1986 cheat and fires a hidden surprise. A large share of 2000s sites wired one in. Click the demo to give it focus, then type the sequence: the four arrow keys in that order, then B, then A.

Where it came from: The Konami Code, a cheat from the 1986 Konami game Gradius, documented on Wikipedia. It spread onto web pages as a hidden trick through the 2000s. Wikipedia

<p id="k" style="font:14px Verdana">Click here first, then type:
<b>up up down down left right left right B A</b></p>

<script>
var seq = [38,38,40,40,37,39,37,39,66,65], pos = 0;
document.addEventListener("keydown", function (e) {
  pos = (e.keyCode === seq[pos]) ? pos + 1 : (e.keyCode === seq[0] ? 1 : 0);
  if (pos === seq.length) {
    pos = 0;
    document.getElementById("k").innerHTML =
      "<b style='color:#ff3d8b;font:bold 22px Verdana'>⭐ CHEAT ACTIVATED ⭐</b>";
    document.body.style.transition = "transform 1s";
    document.body.style.transform = "rotate(360deg)";
  }
});
</script>
sandboxed demo · breaks nothing but itselfrestart

More in browser tricks

all 25 in browser tricks › · the whole library ›