aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md27
1 files changed, 27 insertions, 0 deletions
diff --git a/README.md b/README.md
index a509115..9486311 100644
--- a/README.md
+++ b/README.md
@@ -342,6 +342,33 @@ var use = draw.use(rect).move(200, 200)
In this way the rect element acts as a library element. You can edit it but it won't be rendered.
+### Hyperlink
+A hyperlink or `<a>` tag creates a container that enables a link on all children:
+
+```javascript
+var link = draw.link('http://svgjs.com')
+var rect = link.rect(100, 100)
+```
+
+The link url can be updated with the `to()` method:
+
+```javascript
+link.to('http://apple.com')
+```
+
+Furthermore, the link element has a `show()` method to create the `xlink:show` attribute:
+
+```javascript
+link.show('replace')
+```
+
+And the `target()` method to create the `target` attribute:
+
+```javascript
+link.target('_blank')
+```
+
+
## Referencing elements
### By id