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 Abhishek
Page 4 of 7
How to style background image to no repeat with JavaScript DOM?
In this tutorial, we will learn to style the background image to no repeat with JavaScript DOM. To style the background image to no repeat with JavaScript, use the backgroundRepeat property. It allows you to set whether the background image repeats or not on a page. The use of images in the background really makes the page attractive. But before using the image in the background, one must completely understand the properties used to set the images as the background. Otherwise, it will create problems like not showing the full image in the background, repeating the image horizontally or ...
Read MoreHow to use JavaScript DOM to change the padding of a table?
In this tutorial, we learn to use JavaScript DOM to change the padding of a table. To change the padding of a table, use the DOM padding property. The HTML table is used to display relational data on the user screen. We can easily show related or dependent data to the user and user can easily understand and determine the characteristics of the data with help of table. But, while we are showing the relational data to the user in the form of table, we need to make sure that the table is well structured and looking good according ...
Read MoreHow to use JavaScript to check if a number has a decimal place or it's a whole number?
In JavaScript, determining whether a number is a whole number or has decimal places is a common requirement. This tutorial explores three effective methods to accomplish this task using both built-in JavaScript methods and custom functions. The following methods are available to check if a number is decimal or whole: Using the Math.floor() Method Using the Number.isInteger() Method Using a Custom isDecimal() Function Using Math.floor() Method The Math.floor() method returns the largest integer less than or equal to a given number. By comparing the original number with its ...
Read MoreHow to find out which JavaScript events fired?
In this tutorial, we will learn how we can find out which JavaScript event is fired or triggered. We can add events to HTML elements to perform some actions on the webpage like changing text, form submission, etc. There are two ways of finding which JavaScript event is fired − Using Developer Tools Using Inspect Element Let us discuss both of them one by one with coding examples. Using Developer Tools We can find out which JavaScript event is fired by using developer tools in the browser. ...
Read MoreWhat is Subtraction Operator (-) in JavaScript?
The subtraction operator (-) is a binary arithmetic operator in JavaScript that subtracts the right operand from the left operand. It requires two operands and returns the mathematical difference between them. The subtraction operator follows standard mathematical rules - if the first operand is larger, the result is positive; if smaller, the result is negative. Syntax let result = operand1 - operand2; Basic Examples console.log(9 - 5); // 4 (positive result) console.log(5 - 9); // -4 (negative result) console.log(10 - 10); // 0 (zero result) ...
Read MoreWhat is Unary Negation Operator (-) in JavaScript?
The Unary Negation Operator (-) converts its operand to a number and then negates it. It operates on a single operand and returns the negative value. Boolean values are converted to 0 or 1 before negation, and numbers in different bases are converted to decimal first. Syntax -operand The unary negation operator (-) precedes the operand to negate its value. Basic Examples Let's see how the unary negation operator works with different data types: ...
Read MoreWhat is Modulus Operator (%) in JavaScript?
The modulus operator (%) in JavaScript returns the remainder after dividing one number by another. It's also called the remainder operator and is commonly used in programming for tasks like checking if a number is even or odd. Syntax operand1 % operand2 Where operand1 is the dividend and operand2 is the divisor. The operation returns the remainder of the division. Basic Examples console.log(10 % 3); // 1 (10 ÷ 3 = 3 remainder 1) console.log(15 % 4); // 3 (15 ÷ 4 = 3 remainder 3) console.log(20 % 5); ...
Read MoreHow to use JavaScript to redirect a webpage after 5 seconds?
In this tutorial, we learn to use JavaScript to redirect a webpage after 5 seconds. To redirect a webpage after a delay, we use the setTimeout() method combined with window.location.href to set the destination URL. JavaScript provides two timing methods for delayed execution: setTimeout() for single execution and setInterval() for repeated execution. For page redirection, setTimeout() is the preferred method. To redirect a page we use the window.location.href property to change the current page URL: window.location.href = "https://example.com"; Using setTimeout() Method (Recommended) The setTimeout() method executes a function once after a specified delay. ...
Read MoreWhat is Multiplication Assignment Operator (*=) in JavaScript?
The multiplication assignment operator (*=) in JavaScript provides a shorthand way to multiply a variable by a value and assign the result back to the variable. Instead of writing a = a * b, you can simply use a *= b. Syntax operand1 *= operand2 // equivalent to: operand1 = operand1 * operand2 The multiplication assignment operator is a binary operator that multiplies the left operand by the right operand and stores the result in the left operand. Example 1: Basic Usage with Numbers Here's how the multiplication assignment operator works with numeric ...
Read MoreHow to find JavaScript function definition in Chrome?
When developing or debugging web applications, finding JavaScript function definitions in Chrome is essential. Chrome provides multiple methods to locate functions quickly and efficiently. This tutorial covers three primary methods for finding JavaScript functions in Google Chrome: Using Developer Tools Sources Panel Using Inspect Element Using View Page Source Using Developer Tools Sources Panel The Developer Tools Sources panel is the most powerful method for finding and debugging JavaScript functions. Steps to Use Developer Tools Step 1: Open Developer Tools ...
Read More