Javascript is pretty interesting!!

Describe how you connect an HTML file and a JS file.

I thought connecting an HTML file and JS file would be very different from linking an HTML file to a CSS file, but I found it to be pretty similar and easy. You just need to add<script src=" "></script>in the HTML file. The good thing about this is that you can literally put in anywhere.

Describe the difference between writing code in the Chrome console and writing HTML/JS files that are then open in Chrome.

When writing code in any text editor you have to use the variable console.log( )if you want your work to appear in google console. If you are trying to view something you did in the text editor, you would just open Google and go to the javascript developer console and the work you did will be visible there.

These are the exercises that were done are here:

greeting.html / greeting.js

stalker.html / stalker.js

age-calculator.html / age-calculator.js

The problem sets were not bad it was straightforward but when we had to do the favorite quote program I got stuck but ended up getting it done. Here are here:

desserts.html / desserts.js

credits.html / credits.js

quote.html / quote.js

name.html / name.js

Join the Conversation

1 Comment

  1. Nice use of the code element in your blogging. Helps to read your work!
    And you’re right that you need to have the console open in Chrome to see a console.log(). But the Chrome console can run any JS. You can declare and call functions, you can copy and paste your entire JS into the console. If it works with the particular page that is open, it will work. Or if it doesn’t depend on the page it will work too!

    Some instructors teach all the basics of JS right in the console because you can immediately execute code. My preference has been to use a text editor and HTML/JS files because I think it’s also good practice!

Leave a comment

Your email address will not be published. Required fields are marked *

css.php