I have encountered the following problem:
function Conclude (thing){
this.quant = thing.find('#quantity_material').val();
this.thing = thing;
this.material =[];
this.finish = [];
this.make = function (){
var i=0;
this.thing.each(function(){
this.material [i]= $(this).find('#material_val').val();
//Conclude.material doesn't work either
i++;
});
}
}
I want to assign conclude.material
the values of an input out of several tables so that conclude.material[1]
is value of #material_val
from the first table and so on. The problem is that when I write this, it doesn't refer to function conclude
inside .each()
.
What am I doing wrong?