block by aaizemberg 8246648

simulando tabs (con botones) usando d3.js

Full Screen

index.html

<!DOCTYPE html>
<html>
<head>
  <script src="//d3js.org/d3.v3.min.js"></script>
  <meta charset=utf-8 />
<title>tabs</title>
</head>
<body>
  <button type="button" id="b1">tab 1</button> 
  <button type="button" id="b2">tab 2</button>
  
  <div id='uno'>primer tab</div>
  <div id='dos'>segundo tab, mejor usá --> <a href="//jqueryui.com/tabs/">jquery tabs</a></div>

  <script>
    d3.select("#uno").style("display", "block");
    d3.select("#dos").style("display", "none");

    d3.select('#b1').on('click', function() {
      d3.select("#uno").style("display", "block");
      d3.select("#dos").style("display", "none");
    });
      
    d3.select('#b2').on('click', function() {
      d3.select("#uno").style("display", "none");
      d3.select("#dos").style("display", "block");
    });
  </script>
  
</body>
</html>