I have string. I then split the string to make an array.
I use .each() to hopefully iterate through the array one by one and produce a certain output.
However, when I try to do this, I only get the value in the array outputted.
How comes?
I have set up a jsfiddle to demonstate what I have tried so far and the result I am getting:
var string = 'this is a string';
stringArray = string.split('');
$.each(stringArray, function(index, value){
$('#output').text(index + ' : ' + value);
});
I am trying to achieve it where user inputs text, clicks submit and it returns there input to them, but every time they click submit it replaces the current output.