HTML DOM console.info() method
- Previous Page groupEnd()
- Next Page log()
- Go to the Previous Level Window Console Object
Definition and usage
The console.info() method writes messages to the console.
Tip:When testing console methods, make sure the console view is visible (press F12 to view the console).
Instance
Example 1
Write messages to the console:
console.info("Hello world!");
Example 2
Use an object as a message:
var myObj = { firstname : "Bill", lastname : "Gates" }; console.info(myObj);
Example 3
Use an array as a message:
var myArr = ["Orange", "Banana", "Mango", "Kiwi" ]; console.info(myObj);
Syntax
console.info(message)
Parameter value
Parameter | Type | Description |
---|---|---|
message | String or Object | Required. Write messages or objects to the console. |
Browser Support
The numbers in the table indicate the first browser version that fully supports this method.
Method | Chrome | IE | Firefox | Safari | Opera |
---|---|---|---|---|---|
console.info() | Support | 8.0 | 4.0 | Support | Support |
- Previous Page groupEnd()
- Next Page log()
- Go to the Previous Level Window Console Object