How to put as many js on one page
var random = 1000; setInterval(function() { random = randomizator(60000, 200000); }, 1000); setInterval(function() { showRandom(random); }, random); function randomizator(a, b) { return Math.floor(Math.random() * b) + a; } function showRandom(random) { $('#test').text(random); } <div id="test"></div> Replacing id with class did not work, but I could not do it right.