Im trying to print the realtime output based on user input for a search. so im trying to add the title of each result to a div element of a certain width and height. I want to limit the entries of each div element to 8. so for different search, the number of divs to be displayed will vary.
Im using the below code, since #test is not unique, all output title will be displayed in a single div instead of divs containing 8 titles each..I want to know hw we cn create a div with unique id and use the jquery function to add title to these unique divs..how do i do that?
for(var count5=0;count5
{ $(".panel1").append('<div id="test" style="width:200px; height:120px; background-color:#000000; float:left; margin-left:10px; margin-top:10px; color:#ffffff;"></div>');
for(count4=num; count4<num1; ++count4)
{
$("#test").append(prsnArray[count4].term + '<br>');
}
num=num+8
num1=num1+8}
Instead of appending the terms in your person array to the div with id ‘test'(which is not unique as it should be), append those to the newly created div.