var numbers = Array(); function populate(length, min_value, max_value) { for(var input = 0; input < length; input++) { numbers[input] = Math.round((max_value - min_value) * Math.random() + min_value); } } function reset() { } function sort() { } function repopulate() { populate(25, -100, 100); } function go() { populate(25, -100, 100); document.getElementById('populate').onclick = repopulate; document.getElementById('reset').onclick = reset; document.getElementById('sort').onclick = sort; }