updates to basics

master
Matt Huntington 9 years ago
parent 90e2da504c
commit 4ae93fcb67

@ -14,8 +14,7 @@ d3.select('main').selectAll('span'); //can chain to select ancestors
```javascript ```javascript
d3.select('div').style('color', 'orange'); //sets the style for an element 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('font-size': '20px'); //will return the selection for chaining
d3.select('div').style('color', 'orange').style({'color': 'blue', 'font-size': '40px'}); //will return the selection for chaining
``` ```
### .attr() ### .attr()
@ -47,7 +46,7 @@ d3.selectAll('div').html('<span>hi</span>'); //change the inner html of an eleme
### .text() ### .text()
```javascript ```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 ## AJAX

Loading…
Cancel
Save