LoginSignup
5
5

More than 5 years have passed since last update.

D3.js + bootstrap で消去可能なアラートを表示

Last updated at Posted at 2014-09-19
var dataset = [
  {type:"success", text:"流石ですお兄様"},
  {type:"danger", text:"moudameda..."}
  ];

d3.select("hogehoge")
     .selectAll("div")
     .data(dataset)
     .enter()
     .append("div")
     .attr("class", function(d){ return "alert alert-" + d.type + " alert-dismissable"})
     .text(function (d){return d.text})
     .append("button")
     .attr("type", "button")
     .attr("class", "close")
     .attr("data-dismiss", "alert")
     .attr("aria-hidden", "true")
     .text("\xD7")
5
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
5