support .attr(attributeName, function(index, attr))
Merge pull request #254 from xiaohwan/master

support .attr(attributeName, function(index, attr))