Browsed by
Tag: programming tutorial

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 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