Time for action – executing code in the Console
alert() function to display an alert.
- Open up Chrome. It doesn't matter at this point which website (if any) you go to, since we will be writing a standalone code.
- Open up Chrome DevTools by going through the menu. Go to the Console panel.
- Now, at the bottom of your screen, you'll see an area where you can enter code, designated by >. Clicking anywhere after this will allow you to enter the code.
- Type in the following code, and then hit Enter:
alert('Packt publishing loves open source. You want to write? See http://authors.packtpub.com');
- You should see an
alert box pop-up with the text