1.6 KiB
		
	
	
	
	
	
	
	
			
		
		
	
	
			1.6 KiB
		
	
	
	
	
	
	
	
id, title, challengeType
| id | title | challengeType | 
|---|---|---|
| 587d7fa7367417b2b2512bc6 | Add Inline Styling to Elements | 6 | 
Description
style() method.
The style() method takes a comma-separated key-value pair as an argument. Here's an example to set the selection's text color to blue:
selection.style("color","blue");
Instructions
style() method to the code in the editor to make all the displayed text have a font-family of verdana.
Tests
tests:
  - text: Your <code>h2</code> elements should have a <code>font-family</code> of verdana.
    testString: assert($('h2').css('font-family') == 'verdana', 'Your <code>h2</code> elements should have a <code>font-family</code> of verdana.');
  - text: Your code should use the <code>style()</code> method.
    testString: assert(code.match(/\.style/g), 'Your code should use the <code>style()</code> method.');
Challenge Seed
<body>
  <script>
    const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];
    d3.select("body").selectAll("h2")
      .data(dataset)
      .enter()
      .append("h2")
      .text((d) => (d + " USD"))
      // Add your code below this line
      // Add your code above this line
  </script>
</body>
Solution
// solution required