1ce27d31b7245e94107090a087947ad5d1ac0f51d33c32d1436ffb03f085db7374f17ba94ceece57

Basic JavaScript Tutorial: Using JavaScript - Part 1

Maret 01, 2020 By: Rahman N

There are so many things that can be done using Javascript. By learning Javascript from the basics, it's easier to understand for those of you who want to learn it and try everything you can.

HTML, CSS and JavaScript

JavaScript can run using a Web browser such as Chrome, Mozilla, etc. And usually can be combined with HTML to include script tags. Script elements can consist of JavaScript code directly (Internal) or linked to external sources through the src (External) attribute.

Internal Javascript

For those of you who want to put Javascript, you can put it in a script element, for example like below,
<script>
    alert("Hello ! World");
</script>

External Javascript
The source of External JavaScript is just a text file that uses the .js extension.
To add JavaScript files to a web page / blog, you must use a script tag with the src attribute linked to the url file. For example if there is a file called script.js and the file is in the same directory as the HTML file that you have, then the script element can be written as follows:
<script src='script.js'></script>

Console Javascript
Console is one of the best ways to get the results of the code that we have created directly. If you want to test JavaScript code that is short, I highly recommend you use the Console.


If you use the Modern Browser, you will definitely find one of the tools (usually) called Developer Tools. You can access this tool by right clicking on a web page / blog, then clicking "Inspect Element". Search for the name Console and you can certainly write the JavaScript code there, press enter on the keyboard and the code will run immediately.

Are you ready to learn Javascript next?

If you are ready to learn the continuation of this basic level of Javascript, please wait for the next post. Learning javascript doesn't need to be dizzy, just take it so it's fun to learn: D
View: - Tags: Javascript