I create a array in start of my js,and define button,when click the button a for
loop must push some element to array,but console log show null at end.
I want get for
data in global variable and use it every where
var TableName = [];
$(function(){
$("#SecondButton").on('click',function(){
var TableName = [];
$(".Review").find("input:text").each(function(index,el){
TableName.push(el.value);
});
});
});
console.log(TableName);
});