JavaScript------> Debug JavaScript code------> Use the developer tools in your browser to debug

Source: Internet
Author: User

1. How to open the "developer Tools" in the browser

*360 Secure Browser

* Method One, open the Web page you want to debug, such as Index.html, the top right corner of the browser---tools----developer tools

* Method Two, press the shortcut key F12 directly to open the browser developer tools

      

  

2. Using the developer Tools 2.1 in the browser, use theConsole PanelConsole Panel Overview:      

You can enter JavaScript code in this panel

directly executes the JavaScript code after you press ENTER

1) Console.log (< variable >);//Enter the value of the variable to display      

Example One,

Example Two,

              

              

2.1 Using the source panel in the Developer Tools Source Panel Overview:

This panel allows you to view/edit HTML, CSS, JavaScript code

You can set breakpoints on the corresponding code through the source panel and perform more advanced debugging by stepping

                 

JavaScript------> Debug JavaScript code------> Use the developer tools in your browser to debug

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.