support for elements as anchors

Closes #241