diff --git a/docs/examples/qr-svg-writer/index.html b/docs/examples/qr-svg-writer/index.html
index e9032214..b7abe861 100644
--- a/docs/examples/qr-svg-writer/index.html
+++ b/docs/examples/qr-svg-writer/index.html
@@ -71,7 +71,7 @@
Write QR Code to SVG
})
document.getElementById('saveButton').addEventListener('click', () => {
- const svgData = (new XMLSerializer()).serializeToString(svgElement)
+ const svgData = (new XMLSerializer()).serializeToString(document.getElementById('result'))
const blob = new Blob([svgData])
saveAs(blob, 'zxing-qrcode-example.svg')
})