diff --git a/D3.md b/D3.md index cca7d68..734a520 100644 --- a/D3.md +++ b/D3.md @@ -14,8 +14,7 @@ d3.select('main').selectAll('span'); //can chain to select ancestors ```javascript d3.select('div').style('color', 'orange'); //sets the style for an element -d3.select('div').style({'color': 'blue', 'font-size': '40px'}); //can pass an object -d3.select('div').style('color', 'orange').style({'color': 'blue', 'font-size': '40px'}); //will return the selection for chaining +d3.select('div').style('color', 'orange').style('font-size': '20px'); //will return the selection for chaining ``` ### .attr() @@ -47,7 +46,7 @@ d3.selectAll('div').html('hi'); //change the inner html of an eleme ### .text() ```javascript -d3.selectAll('div').html('hi'); //set the content of the selection to the exact text (no html) +d3.selectAll('div').text('hi'); //set the content of the selection to the exact text (escapes html) ``` ## AJAX