Recent Articles

How to Call a JavaScript Function on Page Load?

To call a JavaScript function on page load, you can attach the onload event handler property to the global window ...
Read More

How to Call Multiple JavaScript Functions in a Single click Event?

To call multiple JavaScript functions in a single click event, separate each function call with a semicolon(;) within the onclick ...
Read More

How to Add Hours to a Date in JavaScript?

To add hours to a date in JavaScript, call the getHours() method on the Date object to get the original ...
Read More

How to Get the Current Quarter Start and End Date in JavaScript?

To get the current quarter start and end date in JavaScript, Get the current date object by calling the Date() ...
Read More

How to Subtract Days from a Date in JavaScript?

To subtract days from a date in JavaScript, call the getDate() method on the given date object to get the ...
Read More

How to Calculate the Number of Days Between Two Dates in JavaScript?

To calculate the number of days between two dates in JavaScript, Pass each date string to the Date() constructor as ...
Read More

How to Convert a Date from YYYY-MM-DD to DD-MM-YYYY Format in JavaScript?

To convert a date from YYYY-MM-DD format to DD-MM-YYYY format in JavaScript, call the String.split() method to split the original ...
Read More

How to Get the Current Date in JavaScript?

In JavaScript, you can easily get the current date by simply calling the Date() constructor without passing any parameters to ...
Read More

How to Get Yesterday’s Date in JavaScript?

To get yesterday's date in JavaScript, call the Date() constructor to get the current or today's date and then simply ...
Read More

How to Check if a Date is Before Today in JavaScript?

To check if a date is before today, first get the today's date object by calling the Date() constructor and ...
Read More

How to Get the Month Name from a Date in JavaScript?

To get the month name from a date in JavaScript, call the toLocaleString() method on the date object by passing ...
Read More

How to Convert Timestamp to a Date in JavaScript?

The UNIX timestamp is defined as the total number of seconds elapsed since January 1st, 1970 00:00:00 UTC. In JavaScript, ...
Read More

How to Get the Current Timestamp in JavaScript?

The UNIX timestamp is defined as the total number of seconds passed since January 1st, 1970 00:00:00 UTC. To get ...
Read More

How to Format a Date to YYYY-MM-DD in JavaScript?

To format a date to YYYY-MM-DD in JavaScript, call the getFullYear(), getMonth() and getDate() methods on the date object to ...
Read More

How to Get One Month Back Date in JavaScript?

To get one month back date in JavaScript, Use the Date() constructor to get the current date object. Call the ...
Read More

How to Get the First Day of Next Month in JavaScript?

To get the first day of next month, Use the Date() constructor to get the current date time object. Call ...
Read More

How to Get the Current Week’s Start and End Date with JavaScript?

To get the current week's start and end date, call the getDate() and getDay() methods on the current date object ...
Read More

How to Add Days to a Date in JavaScript?

To add days to a date in JavaScript, first call the getDate() method on the date object to get the ...
Read More

How to Convert ASCII Codes to Characters in JavaScript?

ASCII stands for American Standard Code for Information Interchange. ASCII codes are basically a standardized set of numerical codes that ...
Read More

How to Convert a Binary String to Plain Text in JavaScript?

Computers understand the language of only two digits 1 and 0, called the binary system. In the binary system, everything ...
Read More

Remove All Special Characters Except Space from a String in JavaScript

To remove all special characters except space from a string in JavaScript, call the replace() method on the string with ...
Read More

How to Remove a Character from a String in JavaScript?

To remove a character from a string in JavaScript, call the replace() method on the string from which you want ...
Read More

How to Reverse Each Word of a String in JavaScript?

To reverse each word of a string in JavaScript, first split the string into a words array using the String.split() ...
Read More

How to Convert a Date Object to a String in JavaScript?

To convert a date object to a string, call the toString() method on the date object which you want to ...
Read More

How to Remove Vowels from a String using JavaScript?

To remove vowels from a string in JavaScript, call the replace() method on the string from which you want to ...
Read More

How to Remove All Whitespaces from a String in JavaScript?

To remove all whitespaces from a string in JavaScript, you can use the String.replace() method. The String.replace() method takes a ...
Read More

How to Remove Empty Strings from an Array in JavaScript?

To remove empty strings from an array in JavaScript, you can use the Array.filter() method. The Array.filter() method takes a ...
Read More

How to Add a Variable Inside a String in JavaScript?

To add a variable inside a string in JavaScript, you can use the template literals. Template literals are a feature ...
Read More

How to Loop Through a String in JavaScript?

In JavaScript, a string is a sequence of characters that represent textual data. It can be any combination of letters, ...
Read More

How to Remove Parentheses from a String in JavaScript?

To remove all the occurrences of parentheses(either '(' or ')' ) from a string in JavaScript, you can call the ...
Read More

How to Change the Background Color on Button Click in JavaScript?

To change the background color of an element on button click, first attach a click event listener to the button ...
Read More

Remove Whitespace from Start or End of String with JavaScript?

To remove the whitespace from the start and end of a string, call the String.trim() method. The String.trim() method returns ...
Read More

How to Get the Position of an Element Relative to Another with JavaScript?

To get the position of an element relative to another, first get the position of the element relative to the ...
Read More

How to Get the Mouse Position Relative to an Element in JavaScript?

To get the mouse position relative to an element, first get the X and Y coordinates of the mouse pointer ...
Read More

How to Remove All Classes from an Element with JavaScript?

To remove all classes from an element in JavaScript, set the className property of the element to an empty string ...
Read More

How to Remove a Class From Multiple Elements in JavaScript?

Removing a class from a single HTML element is quite easy in JavaScript. You can simply pass the name of ...
Read More

How to Toggle an Element’s Class using JavaScript?

Toggling a class is a very popular term in web development, especially when it comes to manipulating the appearance and ...
Read More

How to Get the Current URL with JavaScript?

When a user visits a page of your website or application, the URL of the page is displayed in the ...
Read More

How to Get All the Attributes of a DOM Element with JavaScript?

To get all the attributes of a DOM element, you can use the attributes property of the Element interface. The ...
Read More

Create an Element with Class, Id or Style Attribute in JavaScript

Creating an element is quite easy in javascript. You can simply pass the tag name of the element you want ...
Read More

How to Show and Hide an Element with JavaScript?

Every HTML element on a webpage has a default value for the display property, which determines how the element will ...
Read More

How to Rotate an Image with HTML and CSS?

Images are an essential part of any website. They not only make the site visually appealing but also play a ...
Read More

How to Get and Set a CSS Variable with JavaScript?

When the size of our application or website grows, the amount of CSS code needed to style it also grows ...
Read More

How to Center Align a Table with CSS?

In HTML, tables are used to display data in a structured format. They are commonly used to display data that ...
Read More

How to Increase Font Awesome Icon Size with CSS?

Font Awesome is a very popular icon library that contains a collection of scalable vector icons that can be customized ...
Read More

What is margin auto and How it Works in CSS?

In CSS, the margin: auto; or margin: 0 auto; is a very popular technique to center align HTML elements horizontally ...
Read More

Fix text-align center not Working Problem in CSS

In CSS, the text-align property is used to set the horizontal alignment of text within an HTML element. It can ...
Read More

How to Center Align an Iframe with CSS?

An iframe(<iframe>) is an HTML element that allows web developers to embed another HTML document within the current document. It ...
Read More

How to Add Borders to an Image in HTML & CSS?

Adding a border around an image can change its overall look and appearance. For example, a border with a strong, ...
Read More

How to Keep the Background Image Fixed While Scrolling in CSS?

When you add a background image to an HTML element, by default, the background image scrolls along with the rest ...
Read More

C Program to Find the Sum of Array Elements using Pointers

In this article, we will write a C program to find the sum of array elements using pointers. The program ...
Read More

How to Center a Navbar with CSS?

A navbar is a very important element of your website or application. It typically appears at the top of your ...
Read More

C Program to Take Input from the User

In this article, we will write a C program to take input from the user. The program takes an integer ...
Read More

C Program to Swap Two Numbers using Pointers

In this article, we will write a C program to swap two numbers using pointers. The program takes two numbers ...
Read More

C Program to Check if a Number is Divisible by 3 and 5

In this article, we will write a C program to check if a number is divisible by 3 and 5 ...
Read More

C Program to Check Whether a Number is Positive, Negative or Zero

In this article, we will write a C program to check whether a number is positive, negative or zero. The ...
Read More

C Program to Count Vowels in a String using Pointers

In this article, we will write a C program to count vowels in a string using Pointers. The program takes ...
Read More

C Program to Find the Length of a String using Pointers

In this article, we will write a C program to find the length of a string using pointers. The program ...
Read More

C Program to Check if Two Numbers are Equal using Bitwise Operators

In this article, we will write a C program to check if two numbers are equal or not using the ...
Read More

C Program to Check if Two Numbers are Equal

In this article, we will write a C program to check if two numbers are equal or not. The program ...
Read More

C Program to Find the Sum of Three Numbers

In this article, we will write a C program to find the sum of three numbers. The program takes three ...
Read More

C Program to Add Two Numbers using Function

In this article, we will write a C program to add two numbers using function. The program takes two numbers ...
Read More

C Program to Check Even or Odd using Bitwise Operator

In this article, we will create a C program to check even or odd using bitwise operator. The program takes ...
Read More

C Program to Print all Even Numbers from 1 to N using a while Loop

In this article, we will write a C program to print all even numbers from 1 to n using a ...
Read More

Fix [Error] unknown type name ‘bool’ in C

If you are new to C programming, it is very common that you face an unknown type name 'bool' error ...
Read More

C Program to Check Even or Odd using Functions

In this article, we will write a C program to check even or odd using functions. The program takes a ...
Read More

C Program to Find Diameter, Circumference and Area of a Circle using Functions

In this article, we will write a C program to find diameter, circumference and area of a circle using functions ...
Read More

C Program to Find the Area of Circle using Function

In this article, we will write a C program to find the area of circle using function. The program takes ...
Read More

C Program to Multiply Two Floating-Point Numbers

In this article, we will write a C program to multiply two floating-point numbers. The program takes two floating point ...
Read More

C Program to Convert Kilometers to Meters

In this article, we will write a C program to convert kilometers to meters. The program takes the value of ...
Read More

C Program to Find the Distance Between Two Points

In this article, we will write a C program to find the distance between two points. The program asks the ...
Read More

C Program to Add Two Numbers using Call By Reference

In this article, we will learn how we can add two numbers using call by reference approach. The program takes ...
Read More

C Program to Add Two Numbers using Pointers

In this article, we will learn how we can add two numbers using pointers in C programming. The program takes ...
Read More

C Program to Find the Largest Among Three Numbers using Conditional/Ternary Operator

In this article, we will learn how we can find the largest among three numbers using the conditional/ternary operator in ...
Read More

C Program to Find the Maximum of Two Numbers using Conditional Operator

In this article, we will learn to find the maximum of two numbers using a conditional operator in C programming ...
Read More

C Program to Find the Maximum of Two Numbers using Switch Case

In this article, we will learn how to find the maximum of two numbers using switch case statements in C ...
Read More

C Program to Find Maximum Between Two Numbers?

In this article, we will learn how we can write a C program to find maximum between two numbers. The ...
Read More

How to Print Double Quotes(“”) in C?

In C programming language, double quotes("") are used to define a string literal. The double quotes tell the compiler that ...
Read More

CSS Margin Shorthand Property

When you want to set the margin for an HTML element, you have two options. First, you can use the ...
Read More

How to Print All the Keys of a Dictionary in Python?

In Python, dictionaries are unordered collections of key-value pairs, where each key is mapped to a specific value. When you ...
Read More

How to Put a Container Widget in the Center of the Screen in Flutter?

To put a Container widget in the center of the screen, we can wrap it with a Center widget. The ...
Read More

How to Change the Elevated Button Color in Flutter?

The ElevatedButton button is one of the most commonly used widgets in Flutter. It is a material design button which ...
Read More

How to Center Align App Bar Title in Flutter?

The centerTitle property of the Appbar determines whether the title should be center aligned within the app bar or not ...
Read More

How to Set the Background Color of a Container Widget in Flutter?

A Container widget is a most commonly used widget in Flutter for creating box-like structures. It provides a convenient way ...
Read More

How to Change Icon Color in Flutter?

In Flutter, the Icon widget is used to add icons to your application. By default, the color of the icons ...
Read More

How to Change Text Widget’s Text on Button Click in Flutter?

A Text widget in Flutter is a very commonly used widget which is used to display a block of text ...
Read More

How to Style Only a Part of Text in Flutter?

To style only a part of text in Flutter, you can use the RichText widget. The RichText widget allows you ...
Read More

How to Make a Container Widget Clickable in Flutter?

The Container widget is one of the most commonly used widgets in Flutter. It is like a <div> element in ...
Read More

How to Remove an Element from an Array in MongoDB?

To remove an element from an Array in MongoDB, you can use the $pull operator. The $pull operator in MongoDB ...
Read More

How to Get the Length of a List in Dart or Flutter?

To get the length of a List in Dart, you can use the length property of the List object. The ...
Read More

Count the Number of Documents in MongoDB using Python

To count the number of documents in a MongoDB collection, you can use the count_documents() method provided by the PyMongo ...
Read More

How to Get the Last Inserted Record in MongoDB?

To get the last inserted record from a MongoDB collection, you can use the find() method in combination with the ...
Read More

Delete All Documents in a Collection in MongoDB Using Python?

To delete all documents from a collection in MongoDB, you can pass an empty object {} to the delete_many() method ...
Read More

How to Get the Uploaded File Name in JavaScript?

To upload files in HTML, we use the <input> element with its type="file". This allows us to select and upload ...
Read More

How to Check the Type of an Input Element in JavaScript?

The type attribute in an input element is used to specify the type of input field, such as "text" for ...
Read More

How to Append Text to a DIV using JavaScript?

To append text to a div element in JavaScript, you can use the innerText property of the HTMLElement interface. The ...
Read More

How to Programmatically Select an Option using JavaScript?

A select dropdown is commonly used inside forms that allows users to select an option from a predefined set of ...
Read More

How to Make a CSS Animation Smooth?

By default, a CSS animation starts slowly at the beginning, progresses faster towards the middle of the animation and then ...
Read More

How to Make Text Bold using JavaScript?

There are different ways to make text bold in JavaScript. However, an straightforward way is to use the style.fontWeight property ...
Read More