Saturday, 14 September 2013

How to display the concatenated value in localStorage to listbox

How to display the concatenated value in localStorage to listbox

I have a Object called (rowdata) and that object there is two concatenated
value separated by "\n", i want to display the two value in lisboxt. one
value one row, how to break the two concatenated value and display to
listbox.
code:
var myArray = [[rowdata]]; // assuming rowdata have two value separated by
\n in localstorage
function populate(){
for(i=0;i<myArray.length;i++){
var select = document.getElementById("test"); //ID of the listboxt
select.options[select.options.length] = new Option(myArray[i][0],
myArray[i][1]);
}
}
Is there a way to do that? thank you

No comments:

Post a Comment