docs: Use <a> as example
authorCheng Zhao <zcbenz@gmail.com>
Sun, 3 Jul 2016 06:27:26 +0000 (15:27 +0900)
committerCheng Zhao <zcbenz@gmail.com>
Sun, 3 Jul 2016 06:27:26 +0000 (15:27 +0900)
docs/tutorial/desktop-environment-integration.md

index e430cb4..ab84681 100644 (file)
@@ -329,11 +329,14 @@ app, you need to call `webContents.startDrag(item)` API on `ondragstart` event.
 
 In web page:
 
-```javascript
-document.getElementById('targetItem').ondragstart = (event) => {
-  event.preventDefault()
-  ipcRenderer.send('ondragstart', '/path/to/item')
-}
+```html
+<a href="#" id="drag">item</a>
+<script type="text/javascript" charset="utf-8">
+  document.getElementById('drag').ondragstart = (event) => {
+    event.preventDefault()
+    ipcRenderer.send('ondragstart', '/path/to/item')
+  }
+</script>
 ```
 
 In the main process: