Browsed by
Category: Javascript

JavaScript Variables

JavaScript Variables

A variable is basically a container or place holder for storing data values. Variables are fundamental to all programming languages. Variables are used to store data, like a string of text, numbers, etc. The data or value stored in the variables can be set, updated, and retrieved whenever needed. In general, variables are symbolic names for values.  Declare JavaScript Variables You can create/ declare a variable using the  var  keyword Like this In this example,  myName, age and job are…

Read More Read More

JavaScript Comments

JavaScript Comments

Not all JavaScript statements are “executed”. Comments are lines of code that JavaScript will intentionally ignore. Commenting is a way that you can: Leave no to other developers. Describe what your code does. Leave notes to yourself for the future. Comment out a part of the Javascript code without deleting it. There are two ways to write comments in JavaScript: Single-line Comment Multi-line Comment Single Line Comments Single line comments start with  // ( two forward slashes).Anything you write after…

Read More Read More

JavaScript Syntax

JavaScript Syntax

In computer science, the syntax of a computer language (aka programming language ) is the set of rules that defines the structure of a programming language. And a computer programmer should follow these rules in order for the program to work. JavaScript syntax refers to a set of rules that determine how the language will be written (by the programmer) and interpreted (by the browser). Shortly, as a programmer, you have to follow some rules in order for the program…

Read More Read More

JavaScript Statements

JavaScript Statements

Example JavaScript Programs The idea of the statement is the same in every programming language.A computer program is a list of ‘ instructions’ to be ‘executed’ by a computer.Computers follow these ‘ instructions ‘ or ‘ steps’.Computers read these instructions from top to bottom, one by one.It’s like doing something step by step. But in a programming language, these programming instructions are called statements. Javascript Statements end with a Semicolons ; The idea of ‘statement’ is the same in every…

Read More Read More

JavaScript Output

JavaScript Output

JavaScript can display data in different ways. There are certain situations in which you may need to generate output from your JavaScript code  For example, you might want to see the value of a variable, test your code, get input from the user and so on. JavaScript Display Possibilities Using:  innerHTML. document.write(). window.alert(). console.log(). Using innerHTML To access an HTML element, JavaScript can use the document.getElementById(id) method. The id attribute defines the HTML element. The innerHTML property defines the HTML content. As demonstrated in the following…

Read More Read More

JavaScript Getting Started

JavaScript Getting Started

Before we begin, make sure that you have some working knowledge of HTML and CSS. If you don’t have, you can visit our HTML and CSS tutorials from the menu. What do I need to create JavaScript? You can create JavaScript using the same equipment/ tools you use when creating HTML and CSS. Which is: A Computer Text editor. For example, Notepad (for Windows), Pico (for Linux), or Simpletext (Mac) . Additionally you can use more advanced editors like Atom,…

Read More Read More

JavaScript Tutorial

JavaScript Tutorial

JavaScript is the most popular client-side programming language What is Javascript? Javascript is a programming language. Sometimes you may hear as a scripting language. İt has a lot of uses but in these tutorials we are going to focus on how to use Javascript to add interactivity to web pages. JavaScript is the most popular and widely used client-side scripting language. Client-side scripting refers to scripts that run within your web browser. This tutorial will teach you JavaScript from basic…

Read More Read More