I have different strings in my array. Is it possible to create a divs like
for each array element in my HTML page?
You can use
var results = ['result 1', 'result 2', 'result 3'];
$.each(results, function(idx, value){
var newdiv = $('',{class: 'results', text: value});
$('body').append( newdiv );
});
used $.each() docs, and also changed the id to class since id needs to be unique.
demo at http://jsfiddle.net/gaby/FuPF7/