Found 8591 Articles for Front End Technology

JavaScript Program for Longest Subsequence of a Number having Same Left and Right Rotation

Prabhdeep Singh
Updated on 30-Mar-2023 11:37:09

215 Views

We will implement a code to find the longest subsequence of a given number that has the same left and right rotation in the JavaScript programming language. The left and right rotation of a given number means, for left rotation we have to move the left-most digit of the number to the end position or the rightmost position. Similarly, for the right rotation, we have to move the right-most digit of the number to the first position or the leftmost position. We will see the complete code with the implementation. Introduction to Problem In this problem, we are given a ... Read More

JavaScript Program for Left Rotation and Right Rotation of a String

Shriansh Kumar
Updated on 21-Jan-2025 12:53:37

1K+ Views

To implement left rotation and right rotation of a string, we can use various approaches to implement this problem. Left rotation of a string means anti-clockwise movement of the given number of characters and right rotation of the string means clockwise movement of the given number of characters. In this article we are having a string and a value of k by which we will rotate the string. Our task is to write a JavaScript program for left rotation and right rotation of a string. Example Input: String str = "apple"; k = 3 Output: Left Rotation: ... Read More

JavaScript Program for the Least Frequent Element in an Array

Prabhdeep Singh
Updated on 30-Mar-2023 11:33:39

693 Views

In this program, we are given an array of integers or elements and we have to return the element which presents the least numbers of the time in the array, and if there is more than one least frequent number present we can return any one of them which we are going to see in the article below. Introduction to Problem In the given problem we have to find the least frequent element in an array. Here we have given an array with duplicate numbers and here we have to count the occurrence of each element and among all of ... Read More

JavaScript Program for the Last duplicate element in a Sorted Array

Prabhdeep Singh
Updated on 27-Dec-2024 19:16:44

421 Views

In this article, we are going to explore a Javascript program that works with a sorted array containing duplicate elements. The task is to traverse the array using a loop and identify both the index of the last duplicate element and the duplicate number.  Introduction to Problem In the given problem we have to find the last duplicate element in a sorted array. Duplicate means the number is present more than one time. Example − Input arr[] = {1, 2, 2, 3, 5, 5, 6, 7} Output Last index: 5 Last duplicate value: 5 From the above given sorted array, ... Read More

How to add emoji in HTML document?

Aayush Mohan Sinha
Updated on 30-Mar-2023 10:45:47

3K+ Views

Emojis are small digital images or icons that are generally used in messaging and other places to express emotions or ideas. In this article, we are going to see how we can add emojis to an HTML document. Approach By setting the charset used to display webpages in the browser to UTF-8, emojis can be added to HTML documents. We can use the tag in the head section to specify this character encoding information. Emojis can be added to HTML after the charset has been declared by utilising the p and span tags. While the emoji is inserted in ... Read More

How to add description list of an element using HTML?

Aayush Mohan Sinha
Updated on 30-Mar-2023 10:44:22

471 Views

HTML, which stands for HyperText Markup Language, is a combination of Hypertext and Markup language which we can use to structure a web page and its content. In this article we are going to take a look at how we can add a description list of an element using HTML. tag The tag is used to represent the description list. This tag is used alongside the tags and . Syntax Description List Content Approach We are going to make use of the tag alongside the and tags to add description list of an ... Read More

How to add copyright symbol to your HTML document?

Aayush Mohan Sinha
Updated on 24-Nov-2023 01:44:20

1K+ Views

HTML, which stands for HyperText Markup Language, is a combination of Hypertext and Markup language which we can use to structure a web page and its content. In this article, we will see how we can add the copyright symbol to our web page. Approach The copyright symbol is not present on the keyboard. Therefore, we must use another method to add this to our webpage. We are going to see three different methods − Using hexadecimal code Using HTML code Using HTML entity Method 1: Using Hexadecimal Code The hexadecimal code for the copyright symbol is © ... Read More

How to add controls to an audio in HTML5?

Aayush Mohan Sinha
Updated on 30-Mar-2023 10:40:06

628 Views

HTML5 is a combination of technologies that the user can use for creating more robust and diverse websites and web apps that support multimedia, and communicate with software interfaces, among other things. In this article, we are going to see how we can add controls to audio in HTML5. Syntax The controls attribute of the tag can be used to specify the controls of the embedded audio. It allows the user to technically embed a music player directly in the webpage. The controls attribute adds functionalities such as play, pause, and volume. ... Read More

How to add color picker in a form using HTML?

Aayush Mohan Sinha
Updated on 30-Mar-2023 10:33:57

296 Views

HTML, which stands for HyperText Markup Language, is a combination of Hypertext and Markup language which we can use to structure a web page and its content. This article will show how we can add a color picker using HTML. Syntax For Output Code pre class The tag is an interactive element in HTML whose main purpose is to take different forms of inputs from the user. The tag's type attribute specifies what kind of input the user should enter. Approach We are going to make use of the tag. To accomplish the task, we are going ... Read More

How to add an image as the list-item marker in a list using CSS?

Aayush Mohan Sinha
Updated on 30-Mar-2023 10:32:02

1K+ Views

CSS, the acronym for cascading style sheets, is a straightforwardly built language that makes it easier to present web pages. Applying styles to web pages is possible with CSS.  In this article we are going to see how we can use CSS to add an image as the list-item marker in a list. Approach We are going to make use of the list-style-image property to accomplish the task. The list-style-image property allows the user to set an image as the list-item marker in a list. Syntax list-style-image: none | url | initial | inherit; Example Step 1 − First ... Read More

Advertisements