JavaScript Data Types

JavaScript Data Types JavaScript variables can hold many data types: numbers, strings, objects and more: var length = 16;                               // Number var lastName = “Johnson”;                      // String var x = {firstName:”John”, lastName:”Doe”};    // Object The Concept of Data Types In programming, data types is an important concept. To be able to operate on variables, it is important to know...

Read More

JavaScript Syntax

JavaScript Values The JavaScript syntax defines two types of values: Fixed values and variable values. Fixed values are called literals. Variable values are called variables. JavaScript Literals The most important rules for writing fixed values are: Numbers are written with or without decimals: Strings are text, written within double or single quotes: JavaScript Variables...

Read More

JavaScript Statements

JavaScript Programs A computer program is a list of “instructions” to be “executed” by a computer. In a programming language, these programming instructions are called statements. A JavaScript program is a list of programming statements. In HTML, JavaScript programs are executed by the web browser. JavaScript Statements JavaScript statements are...

Read More

JavaScript Output

JavaScript Display Possibilities JavaScript can “display” data in different ways: Writing into an HTML element, using innerHTML. Writing into the HTML output using document.write(). Writing into an alert box, using window.alert(). Writing into the browser console, using console.log(). Using innerHTML To access an HTML element, JavaScript can use the document.getElementById(id)...

Read More

JavaScript Where To

JavaScript Functions and Events A JavaScript function is a block of JavaScript code, that can be executed when “called” for. For example, a function can be called when an event occurs, like when the user clicks a button. JavaScript inor You can place any number of scripts in an HTML...

Read More

JavaScript Introduction

JavaScript Can Change HTML Content One of many JavaScript HTML methods is getElementById(). This example uses the method to “find” an HTML element (with id=”demo”) and changes the element content (innerHTML) to “Hello JavaScript”: document.getElementById(“demo”).innerHTML = “Hello JavaScript”; JavaScript Can Change HTML Attribute Values In this example JavaScript changes the value of the...

Read More

Welcome to the Digital Strategy Hub

We are in beta and please email support @ centerfordigitalstrategy.com with any issues or features that would make your experience better.


We have a feedback call to hear what would be most useful to you:

Thursday April at 1 ET / 10am PT