Reputation: 511
I read an answer to a question on SO and someone suggested writing directly into the console. I thought, that sounds cool let's give it a go. I proceeded to make an attempt, but I couldn't figure it out. How do I write/run code directly in the console? I tried in Firebug & Firefox's inspector and I did a little Google search as well. Did I misunderstand something?
Upvotes: 0
Views: 1096
Reputation: 20095
Firebug has two ways to execute some code (and write to the console). These are the Command Line at the bottom of the Console panel:
and the Command Editor if you want to write some larger scripts:
which is available by clicking the little arrow at the right side of the Console panel:
The Firefox DevTools have a similar feature to the Command Editor of Firebug called Scratchpad:
This tool is available via the Firefox menu > Developer > Scratchpad or by pressing Shift+F4.
Upvotes: 1
Reputation: 2941
MDN has some example about Outputting text to the console.
The most simple example is:
console.log("Hello World!");
Which should show up in the Firefox Console. (There might be some issue if you use Firebug at the same time)
Upvotes: 0