mySelection.attr( name, value ) in D3.js

Set attribute to a value.

Arguments

nametypedescription
name String
value String Non-string values (e.g. a number like 10) are coerced to strings before setting.
Return Type
Selection

Description

For more details see https://github.com/mbostock/d3/wiki/Selections#wiki-attr.

See Also