I am trying to generate a string of random characters just like this example here
$(document).ready(function(){
$('#randomize').click(function() {
var text = "";
var possible = "michaeljordanisthebestbasketballplayerofalltime";
for( var i=0; i < 5; i++ )
text += possible.charAt(Math.floor(Math.random() * possible.length));
return text;
console.log(text)
$('.shuffle_text').html(text);
});
});
for some reason it is not working on click - the console.log for text is still empty when I run it. Any ideas?