Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles by Shubham Vora
Page 20 of 80
How to set the direction of the flexible items with JavaScript?
In this tutorial, we will learn how to set the direction of the flexible items with JavaScript. The direction of the flexible items can be set using the flex-direction property of CSS. It defines how the flexible items will be placed in the flex container. Its default value is set to 'row', but it can have other values like 'column', 'row-reverse' etc. To set the direction of the flexible items with JavaScript, we have multiple ways, and in this tutorial, we will discuss two of them − Using the style.flexDirection Property ...
Read MoreHow to work with document.anchors in JavaScript?
In this tutorial, let us discuss how to work with the document's anchor in JavaScript. The document.anchors property is a legacy feature that returns a collection of all anchor elements with a name attribute. While modern web development no longer recommends this property, some browsers still support it for compatibility reasons. The anchor tag represents hyperlinks and navigation points within a document. For document.anchors to include an anchor element, it must have a name attribute — elements with only href attributes are not included. Syntax let anchors = document.anchors; Properties length ...
Read MoreHow to set the type of cursor to display for the mouse pointer with JavaScript?
In this tutorial, we will learn to set the type of cursor for the mouse pointer with JavaScript. To set the type of cursor, use the cursor property in JavaScript. It allows you to change the cursor on the button click. We can even change the type of cursor by using JavaScript. Different types of cursors have different meanings. There are many styles of cursors that can use on our webpage. Let us look at how to set the type of cursor to display for the mouse pointer with JavaScript. Using the Style cursor Property The ...
Read MoreHow can I stop a video with JavaScript in Youtube?
In this tutorial, we will learn to stop a video with JavaScript on YouTube. Using the 'iframe' HTML element, we can easily embed the YouTube videos on our application. It is a video player in HTML 5 and has many attributes that users can use according to their needs. In some cases, it happens that you want to create a custom pause or stop button for the embedded YouTube video. Customized buttons are always pretty rather than default ones, making UI pretty. So, we will learn two different methods to create the custom stop button for the YouTube ...
Read MoreHow to work with document.body in JavaScript?
In this tutorial, we will learn how to work with document.body in JavaScript. The document.body property provides access to the HTML element, which contains all visible content of a web page including headings, paragraphs, images, hyperlinks, tables, and lists. In an HTML document, there can only be one element. In this tutorial, we will work with the document.body in JavaScript for: Change the background color of the body Add a new element at the end of the body Change the Background Color Using document.body ...
Read MoreHow to check if a variable is an integer in JavaScript?
In this tutorial, we will learn to check if a variable is an integer in JavaScript. Before we solve the problem, we must have a problem. We can ask ourselves, "why do we need to check if the variable is an integer?". Let's understand the answer using a single example. Suppose, we are taking the value from the user using the input text box. It returns the values in the string format, and now think that we are adding values. Will we get the correct result? Obviously, not. So, in such cases, we need to check if the variable is ...
Read MoreSet how the item will shrink relative to the rest with JavaScript?
In this tutorial, let us look at the way to set how much the item will shrink relative to the rest of the elements in JavaScript. To set item shrink relative to the rest of the elements, we can utilize JavaScript's flexShrink property. Let's take a quick look at this. Using the Style flexShrink Property The flexShrink property specifies how much a flex item will shrink according to the other items in the same container. The element must be flexible for the flexShrink property to function. The property's value functions as a ratio. For instance, if ...
Read MoreWhat does "use strict" do in JavaScript, and what is the reasoning behind it?
In this tutorial, we will learn what "use strict" does in JavaScript and why it's important for writing safer code. The "use strict" directive enables strict mode in JavaScript, which was introduced in ECMAScript 5 (ES5). It enforces stricter parsing and error handling, helping developers catch common mistakes and write more secure code. What is Strict Mode? Strict mode changes both syntax and runtime behavior. It eliminates some JavaScript silent errors by changing them into throw errors, fixes mistakes that make it difficult for JavaScript engines to perform optimizations, and prohibits some syntax likely to be defined ...
Read MoreHow to convert Decimal to Binary in JavaScript?
This tutorial will teach us to convert the decimal number to a binary number string. The binary number is the string of only 0 and 1. The computer doesn't understand the high-level programming language, so we need to instruct the computer in a low-level language, represented as the binary string. Also, binary string is used in digital electronics. Here, we have three methods to convert the decimal number to a binary string. Using the toString() Method Using the right shift Operation Using the modulo Operator Using ...
Read MoreHow to know whether the border and background of empty cells are hidden or not with JavaScript?
In this tutorial, we will learn how to detect whether empty table cells have hidden borders and backgrounds using JavaScript. This is useful when working with dynamic tables where some cells may be empty. The emptyCells CSS property controls whether borders and backgrounds are displayed for empty table cells. JavaScript provides methods to check and modify this behavior programmatically. Understanding Empty Cells Empty table cells can either show their borders and backgrounds or hide them completely. The empty-cells CSS property has two values: show - Display borders and backgrounds for empty cells (default) hide - ...
Read More