I have the following code. I am not sure why the myData array is empty in console.log as inputValue and inputName are not null and I can see them in log
var myData = new Array();
$("#myelement :input").each(function(){
var inputValue = $(this).val();
var inputName = $(this).attr('id');
console.log(inputValue, inputName);
myData.push=inputName;
myData.push=inputValue;
console.log(myData);
});