Author - Pankaj Bains

How to develop an Simple HTML calculator using JavaScript and CSS – Part II

How to develop an Simple HTML calculator using JavaScript and CSS – Part I We have learned in our previous part of Simple HTML calculator using JavaScript and CSS about creating the structure of calculator using HTML and CSS. Now in this section we will implement the JavaScript in our structure. Lets start with adding JavaScript file “calculator.js” on the head section of html page. On top of JavaScript we will declare the variables which are required to complete the functions. var $ [...]

Read more...

How to develop an Simple HTML calculator using JavaScript and CSS – Part I

In this article we will build Simple Calculator with all functionalities as shown on pic using JavaScript and html and CSS for styling. For the ease of understanding we are dividing this into two parts. In first part we will learn how to create structure for calculator and add some styles to give our calculator nice look. In second part we will add the functionality for each button and calculation like log, sin, cos, tan and pi etc with basic functionalities of [...]

Read more...

How to create calendar of current or any month in JavaScript jQuery

In this article we will see how anyone can create simple calendar of current month or any month using jQuery of JavaScript. We know there is date-picker element in jQuery ui however if someone want to create calendar on its own then this code will help him to understand the date() object and how to use various property of that to create the calendar in his desired format. To create calendar we will create one simple html page with jQuery [...]

Read more...

How to toggle in JavaScript to show hide elements

In toggle function we will work on displaying FAQ’s section once user click on a particular link using JavaScript. If user will click on first faq it will show answer of that once. If user click on other faq question it will hide the first one and show the second answer. To achieve this functionality is very simple and can be done with just few line of code. To start with we are going to use below html code to [...]

Read more...

Simple Currency Change Maker in JavaScript

Simple currency change maker in JavaScript is a program with the help of which you can calculate how much change you need for particular amount. This program is helpful in understanding the use of If loop in JavaScript and also Math.floor function and use of modulus in JavaScript. Math.floor: The floor() method rounds a number to the nearest integer, and returns the result. You can learn more about the same at here. Modulus will give you reminder of the given value. In [...]

Read more...

Create a simple stopwatch in JavaScript with Start, Stop and Pause functionality

JavaScript stop watch can be developed using the JavaScript timing methods which are executed in time intervals. JavaScript timing methods automate a particular task to be done on the fly at particular interval without you having to click a button or call an event. JavaScript timing is made up of two key methods: setTimeout( “function”, milliseconds ); clearTimeout( ID name of setTimeout( ) ); How to create stop watch from start: Lets start creating stopwatch using javascript. We will create two files stopwatch.html and stopwatch.js [...]

Read more...

Create a simple digital Clock using JavaScript with 12 hr time format

In this example we will use two files timer.html and timer.js file to display digital clock in JavaScript in 12hr format. If you want to use it for 24 hr that can also be done with just small change explained in code and example below. To start with create one .html file with code below. I have named it timer.html however you can use any other name. Once created insert below .html code on that file and save. You need [...]

Read more...

How to Convert Fahrenheit to Celsius in JavaScript Part II with Data Validation

In this example will helps you to learn and understand about JavaScript programming on how to get user data and validate that on the run. You’ll also let the user to do multiple conversions before ending the application. So basically the formula for finding the Celsius is:  c = ( f – 32 ) x 5 / 9 where “c” is Celsius and “f” is Fahrenheit. So below is my HTML code to convert the value into Celsius. <!doctype html> <html lang=”en”>     <head>         [...]

Read more...

How to Convert Fahrenheit to Celsius in JavaScript

This example of converting Fahrenheit to Celsius in JavaScript will helps you to learn and understand about JavaScript programming. In this example you are going learn to find Celsius from Fahrenheit using pure JavaScript while taking value input from users. I have used JavaScript prompt to take the value from user however you can use simple HTML form to get the value and display the results. So basically the formula for finding the Celsius is:  c = ( f – [...]

Read more...

How to create user/admin login in codeigniter

Let see how to create user login/Admin login page with session in codeIgnitor . CodeIgnitor based on MVC(Model View Controller),  and can be also modified to use Hierarchical Model View Controller  which allows developers to maintain modular grouping of Controller, Models and View arranged in a sub-directory format. I’m using here HMVC method in my example however it can be used in normal MVC method too. First download codeIgnitor from https://codeigniter.com/download and extract zip file and copy all files and [...]

Read more...