var links = document.querySelectorAll('li a'); links[Math.floor(Math.random()*links.length)].click();