Compiler
HTML APIs
HTML Drag/Drop
Run
<!DOCTYPE HTML> <html> <head> <style> #box{ width: 260px; height: 50px; padding: 10px; border: 1px solid #aaaaaa; } </style> <script> function allowDrop(e) { e.preventDefault(); } function drag(e) { e.dataTransfer.setData("text", e.target.id); } function drop(e) { e.preventDefault(); var data = e.dataTransfer.getData("text"); e.target.appendChild(document.getElementById(data)); } </script> </head> <body> <p>Drag the Webtutor image into the rectangle:</p> <div id="box" ondrop="drop(event)" ondragover="allowDrop(event)"></div> <br> <img id="drag" src="https://webtutor.dev/images/logo.png" draggable="true" ondragstart="drag(event)" width="256" height="44"> </body> </html>
Editor Commands
Commands
Shortcut Key (Win)
Shortcut Key (Mac)
selectAll
Ctrl-A
Cmd-A
singleSelection
Esc
-
killLine
-
Ctrl-K (Mac)
deleteLine
Ctrl-D
Cmd-D
undo
Ctrl-Z
Cmd-Z
redo
Ctrl-Y
Shift-Cmd-Z, Cmd-Y
undoSelection
Ctrl-U
Cmd-U
redoSelection
Alt-U
Shift-Cmd-U
goDocStart
Ctrl-Home
Cmd-Up, Cmd-Home
goDocEnd
Ctrl-End
Cmd-End, Cmd-Down
goLineStart
Alt-Left
Ctrl-A
goLineEnd
Alt-Right
Ctrl-E
goLineRight
-
Cmd-Right
goLineLeft
-
Cmd-Left
goLineUp
Up
Ctrl-P
goLineDown
Down
Ctrl-N
goPageUp
PageUp
Shift-Ctrl-V
goPageDown
PageDown
Ctrl-V
newlineAndIndent
Enter
-
save
Ctrl-S
Cmd-S