I need to insert value of each iteration in id="funDirName" and id="addr1" and i have added the below code block for reference:
$(document).ready(function() {
var types = [];
var address1 = [];
var otherTypes = [];
$("input[id*='street_address_']").each(function(index) {
otherTypes.push($(this).val());
address1 = otherTypes[index].split(',');
var obj = {};
obj.funName = address1[0];
obj.addr1 = address1[1];
types.push(obj);
console.log("address1");
console.log(address1);
console.log(types);
var funDirName = address1[index].funName;
$('#funDirName').text(funDirName);
$('#addr1').text(address1[1]);
});
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<p id = "funDirName" style = "margin: 0;" ></p>
<p id = "addr1" style = "margin: 0;" ></p>