creating your first javascript
use this tag inside HTML to make a javascript code
<script></script>
place this tag inside <body> or <head>
Print "Hello World" on the screen with javascript or Create Alert
you can try on Notepad++ or SublimeText
// //
adding external JavaScript
javascript also can be placed as external file, javascript file have a extension .Js, external javascript are useful and practice if you want to call the script repeatedly on any page and it will make your code look clean
and you can call the javascript in HTML like this
<!DOCTYPE html>
<html>
<head>
<title>Learn JavaScript Tutorial on Edankeun.com </title>
</head>
<body>
<script type="text/javascript" src="edan.js"></script>
</body>
</html>
result
Create Comment in JavaScript
comment is using for give an explanation about your code to the programmer or another reader
for example if you want to tell someone that your code is created by You, you can Add the comment in the javascript
with // or /* Add multiple line comment*/
<!DOCTYPE html>
<html>
<head>
<title>Learn JavaScript Tutorial on Edankeun.com </title>
</head>
<body>
<script>
// This is my Code
document.write('Edankeun');
/*This is
my code with multiple comment */
</script>
</body>
</html>
UpcomingTutorial
- Basic Concepts(Variable,Math Operator,String Opration, Logical Boolean)
- Form with JavaScript
- Conditional and Loop
- Function in JavaScript
- Object in JavaScript
okay you just finished your first javascript ,keep follow our tutorial and if this article help you, don't forget to share or comment below if you have some question
thank's for reading keep simply and Cheers!
edankeun.com
Learn Javascript Part I
4/
5
Oleh
Fata EL Islami
1 comments:
cheer up , thanks
Reply