📜  HTML | DOM console.info() 方法

📅  最后修改于: 2021-11-06 11:40:04             🧑  作者: Mango

HTML 中的console.info()方法用于在控制台中写入消息。它表示关于任何元素或对象的重要信息。该消息作为参数发送到console.info() 方法

句法:

console.info( message )

参数:此方法接受单参数消息,该消息是强制性的,用于指定要写入控制台的信息。

下面的程序说明了 HTML 中的 DOM console.info() 方法:

示例 1:

HTML


    
        DOM console.info() Method
        
    
    
        

GeeksforGeeks

        

DOM console.info() Method

         

To view the message in the console press the F12         key on your keyboard.

           

         To view the message, double click the button below:         


                      


HTML


    
        DOM console.info() Method
        
    
    
        

GeeksforGeeks

        

DOM console.info( ) Method

         

         To view the message in the console          press the F12 key on your keyboard.         

           

         To view the message, double click the button below:         


                      


输出:

控制台视图:

示例 2:使用 DOM console.info() 方法显示对象

HTML



    
        DOM console.info() Method
        
    
    
        

GeeksforGeeks

        

DOM console.info( ) Method

         

         To view the message in the console          press the F12 key on your keyboard.         

           

         To view the message, double click the button below:         


                                          

输出:

控制台视图:

支持的浏览器: DOM console.info()方法支持的浏览器如下:

  • 谷歌浏览器
  • 浏览器 8.0
  • 火狐 4.0
  • 歌剧
  • 苹果浏览器