Compiler
JS DOM
DOM Events
Run
<!DOCTYPE html> <html> <style> .red { color: red; } </style> <body onscroll="myFunction()" style="height:2000px"> <h1 id="myh1" style="position: fixed">JavaScript onscroll Event</h1> <script> function myFunction() { if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) { document.getElementById("myh1").className = "red"; } else { document.getElementById("myh1").className = ""; } } </script> </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