Shubham Vora

Shubham Vora

793 Articles Published

Articles by Shubham Vora

Page 13 of 80

How to set the bottom position of 3D elements with JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 310 Views

In this tutorial, we will learn how to set the bottom position of 3D elements with JavaScript. In a web page, handling a 3D element can be tricky. Using JavaScript, we had to set the top, bottom, sides, etc. To set the bottom position of 3D elements, we use the perspectiveOrigin property of an element's style object. Using style.perspectiveOrigin Property In JavaScript, the style.perspectiveOrigin property is used to set the bottom position or base position of a 3D element. Firstly, we get the element object using the document.getElementById() method and then set the style.perspectiveOrigin property. Syntax ...

Read More

How to change the font color of a text using JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 43K+ Views

This tutorial teaches us to change the font color of text using JavaScript. While working with JavaScript and developing the frontend of an application, you may need to change the font color of text when an event occurs. For example, if you have an application that can turn a device on or off with a button, you might want the button text to be green when the device is on and red when it's off. JavaScript provides several methods to accomplish this dynamic color changing. Using the style Property The most common approach is to access an ...

Read More

How to set the style of the line in a text decoration with JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 1K+ Views

In this tutorial, we shall learn to set the style of the line in a text decoration with JavaScript. To set the style of the line in JavaScript, use the textDecorationStyle property. You can set underline, double, or overline, etc. for the line style. Using the Style textDecorationStyle Property We can set or return the line style in a text decoration with this property. The major browsers support this property. Firefox adds support with an alternate property named MozTextDecorationStyle. Syntax object.style.textDecorationStyle = "solid" | "double" | "dotted" | "dashed" | "wavy" | "initial" | "inherit"; ...

Read More

How to change the font size of a text using JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 8K+ Views

In this tutorial, programmers will learn to change the font size of text using JavaScript. Many applications allow users to change the font size according to their requirements. We need to change the default font size using JavaScript to achieve that. Before we move ahead with the tutorial, let's learn what values we can assign to the font size. Different Values for Font Size We can assign the below values to the font size of any element. Every value changes the font size differently: xx-large | x-large | large | medium | small ...

Read More

How to set the indentation of the first line of text with JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 2K+ Views

In this tutorial, we will learn how to set the indentation of the first line of text with JavaScript. The indentation of the first line of a text is a common way to start a new paragraph. To set the indentation, use the textIndent property. To set the indentation of the first line of text with JavaScript, we will discuss two different ways − Using the style.textIndent Property Using the style.setProperty Method Using the style.textIndent Property The style.textIndent property of an element is used to set the ...

Read More

How to load the previous URL in the history list in JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 7K+ Views

In this tutorial, we will learn to load the previous page in the history list in JavaScript. The Window object in JavaScript accesses the window in the browser. This object contains many properties and methods required to do the tasks. The Window object also retrieves the information from the browser window. There is a history stack in every browser that saves the pages visited by the user. To access this history stack, we can use the history object that is the property of the Window object. By accessing the history from the browser, we can go to the ...

Read More

How to change string to be displayed as a subscript using JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 3K+ Views

In this tutorial, we will learn to display strings as subscripts using JavaScript. A subscript is text that appears smaller and positioned below the baseline of normal text. For example, in H2O, the "2" is a subscript. Subscripts are commonly used in mathematics (X1, Y2), chemistry (CO2, H2SO4), and scientific notation. Here, we'll explore both HTML and JavaScript methods to create subscripts. Using HTML Tag The simplest way to create subscripts is using the HTML tag. Any text inside this tag will be displayed as a subscript. Syntax Water is H2O ...

Read More

How to remove an item from JavaScript array by value?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 635 Views

In this tutorial, we will learn to remove an item from a JavaScript array by value. An array is a data structure that can store a collection of elements. JavaScript provides several methods to manipulate arrays, including removing specific elements by their value rather than their index position. Following are the main methods to remove an item from an array by value: The Array filter() Method The Array splice() Method with indexOf() Using the Array filter() Method The filter() method creates a new array containing elements that ...

Read More

How to get the number of the internet host port for the current page in JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 786 Views

In this tutorial, we will learn to get the number of internet host port for the current page in JavaScript. The Port number is a 16-bit unique identifier used by network protocols. Port numbers range from 0-65535 and help servers identify specific processes or services. Each port number has its own identity and purpose in network communication. Following are the methods by which we can get the port number of the internet host: Using the location.port Property Using the URL interface Using the location.port Property ...

Read More

How to set whether the text of an element can be selected or not with JavaScript?

Shubham Vora
Shubham Vora
Updated on 15-Mar-2026 393 Views

In this tutorial, we will learn to set whether the text of an element can be selected or not with JavaScript. Use the userSelect property in JavaScript to enable or disable a text selection. For Firefox, use the MozUserSelect property and set it to none, to disable the selection. The CSS user-select property can set the text on a web page as selectable or nonselectable. But, sometimes, we must restrict the selection to a triggered event or a condition. Then, we can use the JavaScript DOM that provides nearly all CSS properties. So, let us look at how ...

Read More
Showing 121–130 of 793 articles
« Prev 1 11 12 13 14 15 80 Next »
Advertisements