Просто добавьте к нему класс с member.classList.add('member-item')
пример
<head>
<style>
.member-item {
background-color: white;
}
</style>
</head>
<body>
<div id="root" />
<script>
const root = document.querySelector('#root')
async function getData() {
// const response = await fetch("/members");
// const data = await response.json();
const sampleData = [{
firstName: 'Dave',
lastname: 'Smith',
mobile: '0632452345',
contactname: 'Dave',
contactphone: '0632452345',
},
{
firstName: 'Mike',
lastname: 'Smith',
mobile: '06324234345',
contactname: 'Mike',
contactphone: '0635435345',
}]
for(let i = 0; i < sampleData.length; i+= 1) {
const div = document.createElement('div');
div.innerHTML = `
<p>First Name ${sampleData[i].firstName}</p>
<p>Last Name ${sampleData[i].lastname}</p>
<p>mobile Name ${sampleData[i].mobile}</p>
<p>Contact Name ${sampleData[i].contactname}</p>
<p>Contact Phone ${sampleData[i].contactphone}</p>
<hr>
`;
root.append(div)
}
}
getData()
</script>
</body>