Console commands with the developer tools
With direct calls via the element name, the console reaches every element of the DOM and lists the nodes below the element. So, simply document Type in the console line, return and ...
... and already we have a snapshot of the current structure of the DOM, clearly packed under the hinged triangles.
- document Lists the current cathedral
- document.body directly to the body element of the app
- document.head directly to the head element of the app
- document.body.childNodes plays all childNodes of body as an array. The array notation then reaches each element via the index.
- document.body.childNodes  Array notation: The seventh childNode of body
- dir (document.body.childNodes)Alternative representation of the array of all childNodes of body as a vertical list
- document.querySelector ('main') Fish out the element using the querySelector
- $ ('# main') ... this is not a jQuery, but an abbreviation for the console
The console works with Auto-Complete - put a point behind the element and the console will play all commands that make sense at this point.
Arrow up, arrow down scrolls through the history and repeats commands.
Color for the console output
If the output is long and confusing, a dash of color helps ... the CSS for the console, so to speak.console.log ('% c In the wrong if branch again!', 'background: red; color: #eee'); Again in the wrong if-branch!
If there is a% c in front of an argument of the console, the following argument is used as the CSS of the console line.console.log ("Everything is still normal% c But now it's getting yellow", "background: yellow"); Everything is still normal, but now it's turning yellow
- What's the best business for jobs
- What are senior military brass
- What's your favorite Instagram account
- How record labels manage songwriters
- How can you become a sysadmin overnight?
- Canadians learn Spanish
- Lionel Messi is famous for which sports
- What's the greatest number out there
- Why is the jurisprudence backward
- What are some memorable Trumpisms
- TAE is a dense liquid
- Can be split 17
- What is STEM Robotics
- How will the BHMS consultation work in 2018
- Who are the four heirs to Hogwarts
- Who brought the potato to Ireland
- Make upvotes important to you
- Should women enter into a second marriage
- Was ancient Greece secular by today's standards
- What are Sigmund Freud's key idea theories
- What is Metallica's favorite song
- Why not wear a bra
- How did Tangerine Florida get its name
- Should I pursue a YouTube career