Shubham Vora

Shubham Vora

793 Articles Published

Articles by Shubham Vora

Page 71 of 80

How to get the value of the hreflang attribute of a link in JavaScript?

Shubham Vora
Shubham Vora
Updated on 14-Sep-2022 969 Views

In this tutorial, we will learn how to get the value of the hreflang attribute of a link in JavaScript. The hreflang is an attribute of a link or anchor tag which specifies the language of the linked document or href attribute. It is used by search engines to understand the link’s language and the targeted geographical location of the website. For better SEO hreflang attribute must be used. A single language or combination of language and region is used as the value of the hreflang attribute. It uses the language code ISO-639-1 and region code ISO-3166-1. For example: If ...

Read More

How to get the value of PI in JavaScript?

Shubham Vora
Shubham Vora
Updated on 14-Sep-2022 3K+ Views

In this tutorial, we will learn how to get the value of PI in JavaScript. The PI is a mathematical constant that is widely used in different sections of mathematics. It is defined by the ratio of the circumference of a circle to its diameter, which is approximately 3.14159. It is represented by the symbol β€˜πœ‹β€™, which is a Greek letter. The value of PI is an Irrational number, which means the value of the PI can’t be expressed as a fraction, and the digits that came after the decimal is nonβˆ’terminating and nonβˆ’repeating. The value of PI in JavaScript ...

Read More

How to get the tangent of a number in JavaScript?

Shubham Vora
Shubham Vora
Updated on 14-Sep-2022 527 Views

In this tutorial, we will learn how to get the tangent of a number in JavaScript. The tangent of an angle is defined by the ratio of the length of the opposite side to the length of the adjacent side. It can also be defined as the ratio of sine and cosine function of an acute angle where the value of cosine function should not be zero. Mathematically, π‘‘π‘Žπ‘›πœƒ=π‘™π‘’π‘›π‘”π‘‘β„Ž π‘œπ‘“ π‘‘β„Žπ‘’ π‘œπ‘π‘π‘œπ‘ π‘–π‘‘π‘’ 𝑠𝑖𝑑𝑒 / π‘™π‘’π‘›π‘”π‘‘β„Ž π‘œπ‘“ π‘‘β„Žπ‘’ π‘Žπ‘‘π‘—π‘Žπ‘π‘’π‘›π‘‘ 𝑠𝑖𝑑𝑒 also, tanΞΈ=(𝑠𝑖𝑛𝑒 π‘œπ‘“ π‘‘β„Žπ‘’ π‘Žπ‘›π‘”π‘™π‘’ πœƒ)⁄(π‘π‘œπ‘ π‘–π‘›π‘’ π‘œπ‘“ π‘‘β„Žπ‘’ π‘Žπ‘›π‘”π‘™π‘’ πœƒ) Where πœƒ = acute angle in radian The tangent of ...

Read More

How to get the number of forms in a document with JavaScript?

Shubham Vora
Shubham Vora
Updated on 14-Sep-2022 1K+ Views

In this tutorial, we will learn how to get the number of forms in a document using JavaScript. Since different methods are used to create forms in an HTML document, it might get tricky to get the number of forms present. However, you can use some methods to count the forms created without the form tag. Using the length Property The most widely accepted method to create forms in HTML documents is using the tag. Some websites also use tags to create forms in the document. Hence, we will discuss the method to get the number of forms ...

Read More

How to get the length of a string in JavaScript?

Shubham Vora
Shubham Vora
Updated on 14-Sep-2022 4K+ Views

In this tutorial, we will learn how to get the length of the string in JavaScript. While writing any string in JavaScript, we might need to know the number of characters present in it. By knowing an easy method to calculate the length of a string in JavaScript, we can increase or decrease the words and phrases. There are different ways to get the length of a string, but the easiest way is to use the length property of the string. Let’s discuss the different approaches in detail. Using the string.length Property If you want to use a method ...

Read More

How to get the port number part of the href attribute of an area in JavaScript?

Shubham Vora
Shubham Vora
Updated on 14-Sep-2022 519 Views

In this tutorial, we will discover how to get the port number of the href attribute of an area in JavaScript. An area is a tag in JavaScript. This tag is written as . This tag denotes an area inside an image map. This tag has no closing tag. So in HTML, this is an empty tag. In XHTML, this tag must be closed correctly. An image map is also another tag. This tag is written as . An image map contains an image with clickable or active areas. The area tag comes inside the map tag. This tag ...

Read More

How to remove an item from JavaScript array by value?

Shubham Vora
Shubham Vora
Updated on 06-Sep-2022 592 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 data with the same data type. A contiguous memory location is allocated to the array elements. Each array element is identified by its index value. You must process an array by inserting an element, removing or changing, etc. JavaScript has a lot of methods to update an array. Let us take a look at various ways to remove an item from a JavaScript array by value. Following are the Methods/Functions to remove ...

Read More

How to get the arctangent of the quotient of its arguments in JavaScript?

Shubham Vora
Shubham Vora
Updated on 06-Sep-2022 262 Views

In this tutorial, we will learn how to get the arctangent of the quotient of its arguments in JavaScript. The JavaScript math object has several constants and methods for performing mathematical operations. It does not have constructors, unlike the date object. JavaScript Math is one of the built-in objects that contains attributes and methods for mathematical constants and functions, as well as methods for executing mathematical operations. It is neither a function nor a function object. Because Math's properties and methods are static, you can refer to it as an object without constructing it. Following are the ways to find ...

Read More

How to randomize (shuffle) a JavaScript array?

Shubham Vora
Shubham Vora
Updated on 06-Sep-2022 2K+ Views

In this tutorial, we will learn the methods to randomize or shuffle a JavaScript array. We can achieve this by using existing shuffle functions in some libraries or algorithms. Let’s move forward to discuss this. Using the Fisher-Yates Algorithm and Destructuring Assignment Here, the algorithm iterates through the array from the last index to the first index. In each looping, it swaps the array values and creates a random permutation of a finite sequence. We can follow the syntax below for using this algorithm. Syntax for (var i=arr.length – 1;i>0;i--) { var j = Math.floor(Math.random() * (i ...

Read More

How to disable JavaScript in Opera?

Shubham Vora
Shubham Vora
Updated on 30-Aug-2022 1K+ Views

This tutorial will teach you how to disable JavaScript in the Opera web browser. The latest version as used in this tutorial is Versionβˆ’ 89.0.4447.71. About JavaScript The dynamic programming language JavaScript, also known as ECMAScript, was created to provide control over the components of a web application. Your browser loads something on a website known as the Document Object Model (DOM), and JavaScript may work with the items in the DOM to, for example, make a web application responsive to the user. JavaScript is responsible for the existence of every animated menu system, any web form validation or submission, ...

Read More
Showing 701–710 of 793 articles
« Prev 1 69 70 71 72 73 80 Next »
Advertisements