- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 10710 Articles for Web Development
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
2K+ Views
In this tutorial, we are going to learn to change strings to be displayed as a superscript using JavaScript. As the name suggests, the superscript string is displayed at the half-height of the normal string. Also, characters of the superscript string are smaller than the normal string characters.There are a lot of uses of the superscript string while writing the mathematical formulas. For example, A2, B2, 105, etc. Also, we can use the superscript to show the chemical formulas such as O22-, H-, etc.Here, using HTML or JavaScript, users can learn to display string as a superscript.Display string as subscript ... Read More
![Imran Alam](https://www.tutorialspoint.com/assets/profiles/477694/profile/60_3212913-1655890638.jpeg)
39K+ Views
JavaScript provides three mechanisms for storing data on the client − cookies, session storage, and local storage. Each one has advantages and disadvantages.Local storage is the most recent mechanism. It allows for larger amounts of data to be stored, but the data is not deleted when the browser is closed. Local storage is useful for storing data that the user will need to access later, such as offline data.Session storage is similar to cookies, but the data is only stored for the current session. This means that the data will be deleted when the user closes the browser. Session storage ... Read More
![Imran Alam](https://www.tutorialspoint.com/assets/profiles/477694/profile/60_3212913-1655890638.jpeg)
436 Views
Function.prototype.apply and Function.prototype.call are methods that allow you to call a function with a specific this value and arguments. The main difference between the two is that apply lets you pass in an array of arguments, while call requires you to list the arguments one by one.Function.prototype.applyFunction.prototype.apply is a method that allows you to call a function with a specific this value and an array of arguments.SyntaxThe syntax for using apply is −func.apply(thisArg, argsArray)Here thisArg is the value that will be used as this inside the function. argsArray is an array of arguments that will be passed to the function.ExampleHere’s ... Read More
![Kalyan Mishra](https://www.tutorialspoint.com/assets/profiles/493144/profile/60_3341000-1658833471.jpg)
881 Views
In this tutorial, we will see how to convert 3-digit color code to 6-digit color code in JavaScript.So, basically three-digit color code represents the three-digit value of the colour of the form in #RGB format. To convert 3-digit color hex color to 6-digit we just have to do is convert every element of the three digit and make it duplicate.If we say in easy manner, then duplicating the three-digit color will give the hexadecimal whose value is same as three-digit color value.3-digit value: #RGB will be written as #RRGGBB in 6-digit color code.For example, 3-digit value: #08c 6-digit color Code: ... Read More
![Kalyan Mishra](https://www.tutorialspoint.com/assets/profiles/493144/profile/60_3341000-1658833471.jpg)
3K+ Views
In this tutorial, we will design an Analog Clock by the help of HTML, and CSS and make it work using JavaScript which will show the current time in hour, minute, and second format.ApproachWe will use the Date object and by using some calculations we will show hour, minute, and second.We will get the system time from JavaScript object Date() and this object has functions like getHours(), getSecond() and getMinutes().After getting hour, minute, and second format we will apply to transform rotation for all three needles hour, minute, and second.An analog clock shows time with its three hands moving continuously, ... Read More
![Kalyan Mishra](https://www.tutorialspoint.com/assets/profiles/493144/profile/60_3341000-1658833471.jpg)
4K+ Views
In this tutorial, we use different approach to swap two array elements in JavaScript. For example, we swap first and second element of the array asInput −["first", "second", "third", "fourth", "fifth"]Output −["second", "first", "third", "fourth", "fifth"]Here we swapped “first” and “second” value of the array.Now we will look at different methods to swap two elements −Using an extra variableUsing Array Splice() MethodUsing DestructuringMethod 1: Using an Extra VariableIn this method, we will take the help of an extra variable name “temp” and then we do the followingWe will copy the first element to temp.Copy the second element value to the ... Read More
![Kalyan Mishra](https://www.tutorialspoint.com/assets/profiles/493144/profile/60_3341000-1658833471.jpg)
1K+ Views
In this tutorial, we are going to build a project using HTML, CSS, and JavaScript which will be generating a random quote from an API (type.fit).StepsWe will be following some basic steps −Creating HTML Elements and TemplatesAdding Styles using CSSJavaScript LogicCreating HTML Elements and TemplatesThe first step is to create HTML elements and templates. We first add a box in which items will be shown, then we will add a button when the button will be clicked that it will display a new random quote in the box, then span tag is used to show quote sign type font awesome ... Read More
![Kalyan Mishra](https://www.tutorialspoint.com/assets/profiles/493144/profile/60_3341000-1658833471.jpg)
9K+ Views
In this tutorial, we are going to see multiple ways to create an HTML list from a JavaScript array. If we talk about simple HTML list, then we create manually one by one all the lists using ul (unordered list) and inside that li (list) tag.Consider a case when you will have n number of items and you have to print that in a list then it will be a really hectic task to write all the items and print manually right? Then using the JavaScript iteration method this can be easily done.Let’s see various ways in JavaScript to create ... Read More
![Kalyan Mishra](https://www.tutorialspoint.com/assets/profiles/493144/profile/60_3341000-1658833471.jpg)
536 Views
In this tutorial, we will check if two numbers are approximately equal or not. In case given two numbers are equal then we will print yes, it is otherwise not it’s not.But let me make you clear that we are not going to do any magic here, basically we will also have to give an epsilon value.So, when we calculate the absolute difference between those two numbers and then compare with the epsilon then if absolute difference is lesser than the epsilon then the numbers are approximately equal else not approximately equal.Suppose two numbers given is 6.79 and 6.75 and ... Read More
![Manisha Patil](https://www.tutorialspoint.com/assets/profiles/492968/profile/60_3302943-1658812948.jpg)
134 Views
concat() method The fundamental operation for combining two strings is concatenation. String combining is a necessary part of programming. We need to first clear out the fundamentals before we can discuss "String Concatenation in JavaScript." A new string is produced when an interpreter performs the operation. In order to create a new string, the concat() method joins the calling string and the string arguments. The initial string and the string that was returned are unaffected by changes to either. When concatenating, string values are first transformed from parameters that are not of the type string. Syntax Following is the syntax ... Read More