Found 6685 Articles for Javascript

How to Create Pong Game in JavaScript?

Prince Varshney
Updated on 18-Oct-2022 11:44:19

2K+ Views

A Pong game is a two-player paddle game where each player’s task is to save the ball from hitting the wall. Whenever player 1 hits the ball at the opponent’s wall then player one will receive a point, and similarly, player 2 will get a point if he/she hits the ball at the opponent’s wall. In this tutorial, we will create a Pong Game in JavaScript. Approach To make the pong game using JavaScript we need to write code in HTML, CSS, and JavaScript. We have written certain functions in JavaScript to build the Pong game which is defined below ... Read More

How to change an element's class with JavaScript?

AmitDiwan
Updated on 18-Oct-2022 07:23:47

368 Views

The className property is used to change an element’s class. Here, we will see two examples − How to change the element’s class using className property. How to toggle between old and new classes. Change the element’s class using className property In this example, we will change the class of an element using the className property. Let’s say we have a div with class oldStyle − The div... We will set the above oldStyle class to a new class i.e. newStyle using the className property − function demoFunction() { ... Read More

How to avoid jQuery function conflict with any other JavaScript library

Shubham Vora
Updated on 12-Oct-2022 11:47:03

821 Views

In this tutorial, we will learn how to avoid jQuery function conflict with any other JavaScript library. For the jQuery function, the $ symbol is simply an identifier. A $ followed by a selector indicates that it is a jQuery selector. It is given a shorter identification as $ to save time while writing longer syntax. It includes all of the functions needed by a jQuery object, such as animation(), show(), hide(), show(), CSS, and many others. Furthermore, $ is superior in terms of memory to jQuery because $ takes a byte while jQuery uses 6 bytes for the same ... Read More

Voca: The Ultimate Javascript library for String Manipulation

Mukul Latiyan
Updated on 11-Oct-2022 14:24:39

359 Views

Voca is a JavaScript library that is used for manipulating strings. In this tutorial, we will take multiple examples to show how you can use the different functions available in Voca. Features of Voca Before we see all the examples, let's highlight some features that Voca brings to the table − It provides a multitude of functions that can be used to manipulate, query, escape, format strings. It also provides a detailed and searchable documentation. It supports a wide range of environments like Node, js, Safari 7+, Chrome, Firefox etc. It doesn't require any dependencies How to Install ... Read More

Logging HTTP Requests and Errors using Morgan.js

Mukul Latiyan
Updated on 11-Oct-2022 14:18:24

2K+ Views

Morgan is a middleware that is available for Node.js which is used when we want to log HTTP requests. It is mainly used in Express projects. Morgan helps us simplify the logging work of HTTP requests that come and sent from an application in a single statement. In normal situations, developers often write all the logging code by hand and then end up logging what to store, how to save, and where everything is saved. It helps in gathering logs from your server and also prepares them for reading. It also has many predetermined defaults built-in to help the developers. ... Read More

TaffyDB – A JavaScript Database for Your Browser

Mukul Latiyan
Updated on 15-Jun-2023 14:48:55

250 Views

TaffyDB is a lightweight and powerful in-memory database that can be used in both browser and server-side applications. It is open-source and free to use. In this tutorial, we will take a couple of examples to show how you can use TaffyDB to store some data, execute some queries on the data, and also perform important operations on the data. Let's Start with a Simple Example Let's start with a very basic example in which we will create some data and then try to print that data on the browser. The first step for us is to have TaffyDB. For ... Read More

Working with HTML5 Canvas Elements using Easel.js

Mukul Latiyan
Updated on 15-Jun-2023 15:16:14

181 Views

The popularity of HTML5 Canvas elements is well known, as they allow web developers to create animations, full-fledged applications, interactive charts as well. But sadly, it is very hard for someone to understand canvas, especially if he/she has come from the Flash animation background. In this tutorial, we will explore the Easel.js library, which allows us to work with HTML5 Canvas elements. The syntax of Easel.js is similar to ActionScript and it even has features like Display List, Stage, Graphics which ultimately makes the use of canvas easier for the Flash developers. Now that we have a little idea about ... Read More

Validating a Form with Parsley.js

Mukul Latiyan
Updated on 15-Jun-2023 15:07:51

1K+ Views

In this tutorial, we will show how you can use Parsley.js, which is a JavaScript library that is mainly used to validate forms. Parsley helps in validating the forms in a very subtle and easy manner, and it is one of the widely used form validation libraries out there. Features of Parsley.js There are plenty of reasons why Parsley is a good choice for validating your JavaScript forms. Some of them are mentioned below. Intuitive DOM API − The DOM API allows you to use simple English inside your HTML tags, and Parsley will do the rest. There's no ... Read More

Position Tooltips and Popovers using Popper.js

Mukul Latiyan
Updated on 15-Jun-2023 14:21:29

2K+ Views

Popper.js is a JavaScript library that is used when we want to build poppers and tooltips and manage them. It helps us in positioning tooltips and popovers in most modern web applications. In this tutorial, we will show how you can use Popper.js to position tooltips, but it should be noted that Popper is not just all about tooltips, yet is somewhat the foundation on which it is built. Let's Start with a Small Example Let's create a simple tooltip with a button to understand how we can use popper.js. The first step is to install popper.js on our machine. ... Read More

How to create your first chart with FusionCharts.js?

Mukul Latiyan
Updated on 15-Jun-2023 13:43:10

273 Views

FusionCharts is a JavaScript library that you can use when you want to create charts and maps and put them in your web application. In this tutorial, we will show how you can use FusionChart.js to create two different charts. Before we learn how to create charts, the first important thing is to know how we can install FusionCharts onto our local machines. Installing FusionCharts There are multiple ways with which we can install FusionCharts. Using CDN You can use the CDN link given below to directly gain access to the files of FusionCharts. Install from NPM You ... Read More

Advertisements