d3's on function serves the purpose better:

  .on("click", function(d, i) {
    location.href = script + "&param=" + d.amt;

attr sets the target statically, while creating the elements. on determines the target dynamically, when the click occurs.

Apart from that, d.amt is correct, and I'd also expect your attr variant to work.

Related Query

More Query from same tag