"Pijl" is the div I want to rotate randomly. "Knop" is the button that is needed to make the div rotate.
var pijl = document.querySelector("#arrow");
var knop = document.querySelector("#bottom");
var spin = Math.round(Math.random() * (360));
knop.addEventListener("click", draai);
function draai(evt) {
pijl.rotate(spin + "deg");
}