Skip to content

Commit 1a6e359

Browse files
committed
fixed svg createelementns thing
1 parent c364c51 commit 1a6e359

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

svg.markdown

+3-3
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ You can also dynamically construct elements with javascript!
181181
Constructing elements is a bit weird:
182182

183183
``` js
184-
var svg = document.createElementNS('svg', 'http://www.w3.org/2000/svg');
185-
var circle = document.createElementNS('circle', 'http://www.w3.org/2000/svg');
184+
var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
185+
var circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
186186
```
187187

188188
---
@@ -191,7 +191,7 @@ var circle = document.createElementNS('circle', 'http://www.w3.org/2000/svg');
191191
All of the usual dom methods work on svg:
192192

193193
``` js
194-
var circle = document.createElementNS('circle', 'http://www.w3.org/2000/svg');
194+
var circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
195195
circle.setAttribute('fill', 'cyan');
196196

197197
var circle2 = elem.cloneNode(true);

0 commit comments

Comments
 (0)