Easy Graph Generating Code
If you want to display a graph on your web page, you could use a graphics program to draw the graph, but that's time consuming and the resulting graph is static, it can't change or grow. In this article I will show you how to generate graphs using JavaScript. More ...
Code to Drag and Drop an Image Anywhere on a Webpage
HTML5's drag-and-drop standard is designed to let you drag text or data from a textbox or table cell, to another textbox or table cell. But what if you want to drag an image, not to a target element, but to anywhere on a webpage. Then HTML5 drag-and-drop falls short. More ...
JavaScript to Generate a Random Number Between X and Y
You can use the JavaScript Math object's .random() method to generate a random number between two values, it returns a random floating-point number between 0 and 1 so you'll need to perform additional operations on it to scale it. More ...
Easy JavaScript Web Storage Code
In the past allowing web pages to store data on your PC was considered too dangerous. Cookies can not be considered permanent and reliable storage. HTML5 brings us web storage, providing methods to store keyword/value data pairs in the user's browser. More ...
JavaScript to Set Checkbox to Readonly
The HTML checkbox element does not have a readonly attribute. This example provides a very simple work around that might help you solve the checkbox readonly problem in your own application. More ...
Debugging JavaScript : Coercions
JavaScript is not a tightly typed language. Sometimes this comes in handy, but other times it can cause problems. More ...
Easy Fading Text Banner Code
In this article you learn how to create a fading text banner, a fading text banner with several different messages that fade in and out, and a fading image banner with several different image banners that fade in and out. You also learn how to use the document.write method so that you can give a link to others to include your banners in their webpage. More ...
JavaScript Code for Binary to Decimal - Decimal to Binary Conversion
To convert a binary number to decimal add together the decimal weight of all positions that contain a 1. To convert a decimal number to binary place a 1 in all positions where you can subtract the weight of the binary position. More ...
JavaScript to Replace All Occurrences of a Substring Within a String
If you have a string with multiple occurrences of a substring within and you want to replace every occurrence of that substring with a different substring, this article provides a simple code example. More ...
Easy Java Script Code to Fill Array With Random Numbers
The code I present here might not be the fewest lines possible to fill an array With random numbers, but it is the easiest to understand. More ...
Calculate The Points of an Equilateral Triangle
Starting an equilateral triangle is easy, you just draw a line. However, drawing the third point to create an exact equilateral triangle requires a bit of calculation. More ...
JavaScript to Add and Remove Rows and Cells from a Table
If you need a client-side application where you have a table that you want to enable the user to add and remove rows and cells, this article provides you with JavaScript code to easily accomplish that. More ...
