Some other important things to know when scripting with JavaScript. JavaScript is Case Sensitive A function named "myfunction" is not the same as
In JavaScript you can add special characters to a text string by using the backslash sign. Insert Special Characters The backslash ...
Using the onerror event is the old standard solution to catch errors in a web page. Examples The onerror event (an example ...
The throw statement allows you to create an exception. Examples The throw statement How to use the throw statement. ...
The try...catch statement allows you to test a block of code for errors. Examples The try...catch statement How to write a ...
Events are actions that can be detected by JavaScript. Events By using JavaScript, we have the ability to create dynamic web pages. Events ...
The for...in statement is used to loop (iterate) through the elements of an array or through the properties of an object. Examples ...
There are two special statements that can be used inside loops: break and continue. Examples Break statement Use the break statement to ...
Loops in JavaScript are used to execute the same block of code a specified number of times or while a specified condition is true. ...
A function is a reusable code-block that will be executed by an event, or when the function is called. Examples Function How to ...
In JavaScript we can create three kinds of popup boxes: Alert box, Confirm box, and Prompt box. Examples Alert box Alert box ...
Arithmetic Operators Operator Description Example Result + Addition x=2 y=2 x+y 4 - ...
Conditional statements in JavaScript are used to perform different actions based on different conditions. Examples Switch statement How to write a switch statement. ...
Conditional statements in JavaScript are used to perform different actions based on different conditions. Examples If statement How to write an if statement. ...
A variable is a "container" for information you want to store. Examples Variable Variables are used to store data. This example will show ...
JavaScript comments can be used to make the code more readable. JavaScript Comments Comments can be added to explain the JavaScript, or to ...
JavaScripts in the body section will be executed WHILE the page loads. JavaScripts in the head section will be executed when CALLED. Examples ...
The HTML <script> tag is used to insert a JavaScript into an HTML page. Examples Write text with Javascript The example ...
JavaScript is used in millions of Web pages to improve the design, validate forms, detect browsers, create cookies, and much more. JavaScript is the ...