I am trying to traverse my map on javascript to use the keys and values to form the input type="text" 's id and name = map's key and value = tempMap[key]
var tempMap = {"user" : “abc”,"password" : “xyz”,"Month” : "1", “Year” :“2016”}
for(item in tempMap){
var itemVal = tempMap[item];
var defaultRow = $('<tr> '+
'<td> '+
'<div class="mno">'+
'<label style="width: 150px;">'+item+':'+'</label>'+
'<input type="text" name="'+item+'" id="' +item+ '" value = "' +itemVal+ '" />'+
'</div>'+
'</td>'+
'</tr>' );
}
for label it is working good, but its not working for input tag. How can I achieve this.
=for thevalueattribute.