function fun(){
var a=10;
var b=20;
document.getElementById("output1")=a;
document.getElementById("output2")=b;
}
This is a JavaScript function
var Data = [{label="1", value=output1},{label="2", value=output2}];
I want the values of a and b to be used in the array Data. But I am unable to access it. Hope one will get through this soon.