I want the user when he/she clicks a button for a value from an array to be inserted into one of five div boxes. The code has no errors on firebug but when I click the button nothing happens. What's wrong with my code. Here is the jsfiddle example http://jsfiddle.net/fHHnq/13/
Here is the relevant js code...
var news = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11",
"12", "13", "14", "15", "16", "17", "18", "19", "20"];
$(document).ready(function() {
$('.button').click(function() {
var article_id = 1;
var number = Math.floor(Math.random() * 5) + 1;
$('.class_' + number).html('news[article_id]');
article_id++;
});
});
news[article_id]