Home Contact About

JavaScript Functions

Call a function which performs a calculation and returns the result:

  



  




  





Name:

Please input a number between 1 and 10:




Hello World!



Mouse Over Me

This example uses the addEventListener() method to add two click events to the same button.


Add addEventListener() method to attach a click event to a button.





















This is a paragraph.

This is another paragraph.



If you double-click on me, I will disappear.

Click me away!

Click me too!



Enter this paragraph.






Name:

Email:

This is a paragraph with little content.

This is another small paragraph.



Demonstrate fadeIn() with different parameters.










Click here to slide the panel down or up .. Toggle effect
Hello My Dear






By default, all HTML elements have a static position, and cannot be moved. To manipulate the position, remember to first set the CSS position property of the element to relative, fixed, or absolute!


Ashraf






My First Bootstrap Page

This container has a border and some extra padding and margins.

My First Bootstrap Page

This container has a dark background color and a white text, and some extra padding and margins.

My First Bootstrap Page

This container has a blue background color and a white text, and some extra padding and margins.


Four equal width columns

Note: Try to add a new div with class="col" inside the row class - this will create four equal-width columns.

First Column
.col
.col
Latest Column

Two Unequal Responsive Columns

Resize the browser window to see the effect.

The columns will automatically stack on top of each other when the screen is less than 576px wide.

.col
.col

Background Color with Contrasting Text Color

This text is important.

This text indicates success.

This text represents some information.

This text represents a warning.

This text represents danger.

Secondary background color.

Dark grey background color.

Light grey background color.


Hoverable Dark Table

The .table-hover class adds a hover effect (grey background color) on table rows:

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com

Contextual Classes

Contextual classes can be used to color the table, table rows or table cells. The classes that can be used are: .table-primary, .table-success, .table-info, .table-warning, .table-danger, .table-active, .table-secondary, .table-light and .table-dark:

Firstname Lastname Email
Default Defaultson def@somemail.com
Primary Joe joe@example.com
Success Doe john@example.com
Danger Moe mary@example.com
Info Dooley july@example.com
Warning Refs bo@example.com
Active Activeson act@example.com
Secondary Secondson sec@example.com
Light Angie angie@example.com
Dark Bo bo@example.com

Table Head Colors

You can use any of the contextual classes to only add a color to the table header:

Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
July Dooley july@example.com
Firstname Lastname Email
John Doe john@example.com
Mary Moe mary@example.com
Span two columns example july@example.com

Circle

The .rounded-circle class shapes the image to a circle:

Cinque Terre

Alerts

Alerts are created with the .alert class, followed by a contextual color classes:

Success! This alert box could indicate a successful or positive action.
Info! This alert box could indicate a neutral informative change or action.
Warning! This alert box could indicate a warning that might need attention.
Danger! This alert box could indicate a dangerous or potentially negative action.
Primary! Indicates an important action.
Secondary! Indicates a slightly less important action.
Dark! Dark grey alert.
Light! Light grey alert.

Button States

Disabled Link


Let AJAX change this text


JavaScript Window & Screen & Location






JavaScript Prompt



JavaScript Geolocation

Click the button to get your coordinates.



Fetch a file from Server to the Browser -- No need for XMLHttpRequest anymore



The XMLHttpRequest Object







Convert JSON data into a html table using Javascript

Click the following button to convert JSON results into HTML table



Resulting Table:




JavaScript Geolocation

Click the button to get your coordinates.


JavaScript Validation Using Forms API

Enter a number and click OK:

If the number is less than 100 or greater than 300, an error message will be displayed.


JavaScript Validation Min Value using Forms API

Enter a number and click OK:

If the number is less than 100 (the input's min attribute), an error message will be displayed.


Local Storage Example "Web Storage API"



Convert a string into a date object.



Creating an Object from a JSON String




Create a JSON string from a JavaScript object.


Create a JSON string from a JavaScript array.


Store and retrieve data from local storage.


Access a JavaScript Object


Looping Object Properties


Looping an Array


Click the button to display the cookies associated with this document.



Name:


Finding HTML Elements Using document.forms



Finding HTML Elements Using document.images



(Show / Hide) Document Texts with selector p





End of Page