JSFiddle - React, Tailwind, and code Playground
HTML
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
<div>7</div>
JavaScript
var rnd1, rnd2, rnd3, undef,
items = $('div');
// Generate our random numbers:
rnd1 = Math.floor(Math.random()*items.length);
while (rnd2 == undef || rnd2 == rnd1)
rnd2 = Math.floor(Math.random()*items.length);
while (rnd3 == undef || rnd3 == rnd1 || rnd3 == rnd2)
rnd3 = Math.floor(Math.random()*items.length);
console.log(rnd1, rnd2, rnd3);
//filter our items, only the ones whose index matches one of our randoms:
items.filter(function (index) {
return index == rnd1 || index == rnd2 || index == rnd3;
}).remove();