Firebug has a multiline feature in their console tool. Is there a way to get this functionality with the debugger tool in Safari/Chrome?
-
You can use a chrome extension called "BigConsole", i find it very handy. – Marco Caggiano Jul 10 '19 at 19:10
9 Answers
Shift-Enter on Windows allows multi-line entry where Option-Enter works on Mac.
A more fully featured editor is in the works.

- 1,516
- 2
- 10
- 2
-
8Ctrl-Enter and Shift-Enter also work (for me!) on Mac OS (I'm using Chrome 14; can't vouch for earlier versions.) Also, pasting in multi-line code 'just works'. To run multi-line code, press Enter. – Sam Dutton Sep 14 '11 at 14:46
For Google Chrome
, you can Sources >> Snippets >> + New Snippet
in the Developer Console
.
Once you have written your multi-line code
, you can execute it with the
button
or with Ctrl + Enter
as mentioned on the button
.
This is like a text-editor which has a host of keyboard shortcuts
which you can find under Settings >> Shortcuts
under Text Editor
Good Luck.

- 21,375
- 7
- 100
- 81
I recommend this:
- Write
debugger;
and hit Enter, in the console tab - This takes you to the Sources tab; if not, make sure debugger breakpoints are active
- Now you can write whatever you want in the Sources tab, which acts like a full IDE with features like newline and indentation
- Select any part of your code to run, and right-click, choose
Evaluate in console

- 35,341
- 41
- 136
- 188
-
1That's cool, thanks. Is there a keyboard shortcut for 'Evaluate in console'? – Sv1 Jun 07 '17 at 14:55
http://code.google.com/p/chromium/issues/detail?id=35487
Not yet.
UPDATE: the status of the issue I linked to is now "fixed".

- 13,132
- 15
- 75
- 92
-
10For those who might only read this answer: multi-line console entry is now possible in the Chrome dev tools, as per MrBester's answer below. – Sam Dutton Sep 14 '11 at 14:43
-
1imho - the snippets feature is the best way to handle this: https://developers.google.com/chrome-developer-tools/docs/authoring-development-workflow#snippets - plus you get the added benefit of creating lots of them and reusing them. – PhillipKregg Feb 14 '14 at 17:24
Try pressing option (shift on Windows) at the same time as return. Inserts a newline on Mac.

- 4,413
- 28
- 42

- 923
- 1
- 7
- 15
Shift + Enter seems to work in chrome browser. I am using ubuntu 12.04 as my operating system. Thanks to Mr Bester and Sam Dutton for their inputs.

- 865
- 10
- 18
It is simple ... place semicolons between your multilines and it will work in the console.
For example
if you have html like this
<div id="test">This is a test statement</div>
You could paste following in the console and it will work
var ourTest = document.getElementById('test'); alert(ourTest.innerHTML);
I hope it helped.

- 3,465
- 6
- 37
- 56
There is cool extension to chrome https://chrome.google.com/webstore/detail/bigconsole/klommbdmeefgobphaflhmnieheipjajm
It just add another tab named BigConsole and it allow multiline code execution

- 4,518
- 2
- 21
- 30
Try using the notepad (or someting else) and then copy/paste to the console, works for me!!!!

- 47
- 4