Edit in JSFiddle

//Array with 4 objects
var dataArray = [
	{value : 'one', color:'red', width: 100},
	{value: 'two', color:'green', width: 200},
	{value: 'three', color:'blue', width: 150},
	{value: 'four', color:'yellow', width: 300}

function render(data) {
 	//First use data function and pass data
	var updateDivSelection = d3.select('body').selectAll('div').
	//But updateDivSelection will be empty

	//Use enter to append the divs
	var enterDivSelection = updateDivSelection.enter().
		text('div'); // Simply printing text 'div' in div

//Calling render function and passing the data
<!-- no div elements initially -->