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
Articles by Shubham Vora
Page 71 of 80
How to get the value of the hreflang attribute of a link in JavaScript?
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 MoreHow to get the value of PI in JavaScript?
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 MoreHow to get the tangent of a number in JavaScript?
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 MoreHow to get the number of forms in a document with JavaScript?
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 MoreHow to get the length of a string in JavaScript?
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 MoreHow to get the port number part of the href attribute of an area in JavaScript?
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 MoreHow to remove an item from JavaScript array by value?
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 MoreHow to get the arctangent of the quotient of its arguments in JavaScript?
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 MoreHow to randomize (shuffle) a JavaScript array?
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 MoreHow to disable JavaScript in Opera?
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