Front End Technology Articles

Page 221 of 652

Maintenance with CSS

Tanmay Chandhok
Tanmay Chandhok
Updated on 18-Jan-2023 1K+ Views

CSS is widely known as the cascading style sheets and is used to style the elements which are created using the HTML tags and is responsible for the look and feel of the webpage. We can use CSS to change the color of the text, change the background, add any image or give space between texts. We can create many ways to display a single piece of content. In this article, we are going to explain the ease of maintenance with CSS and what are the benefits of the CSS. Advantages of CSS Following are the advantages of using CSS ...

Read More

How to dynamically create radio buttons using an array in JavaScript?

Yaswanth Varma
Yaswanth Varma
Updated on 18-Jan-2023 6K+ Views

Creating radio buttons dynamically using an array in JavaScript is a useful way to provide users with multiple options for input. When the user clicks on one of the radio buttons, it will be selected and any other choices will be deselected automatically. This process can be automated by looping through an array that contains all the possible values and creating a new radio button element for each item in the array. To dynamically create radio button using an array, use the concept of createElement() and appendChild().Let’s look at the concept to understand more about dynamically creating a radio buttons. ...

Read More

How can I show a hidden div when a select option is selected in JavaScript?

Yaswanth Varma
Yaswanth Varma
Updated on 18-Jan-2023 17K+ Views

Showing and hiding elements is a common task in JavaScript. It can be used to create dynamic user interfaces, where the content changes depending on the user's input or interaction with the page. One way of doing this is to show a hidden div when a select option is selected. This article will guide you through how to do this using JavaScript. A Boolean attribute is the one that was chosen. It indicates that a choice should be preselected when the page loads if it is present. In the drop-down list, the pre-selected option will be shown first. To ...

Read More

Replace whitespace in different elements with the same class in JavaScript?

Yaswanth Varma
Yaswanth Varma
Updated on 18-Jan-2023 482 Views

In this article we are going to learn about replace whitespace in different elements with same class in JavaScript. Let’s look into the article to learn more about replacing whitespaces in different elements. Using split() and join() Methods The split() method divides a string into several substrings and returns them as an array. When a separator is present in the string, the string is split according to the separator that was specified as a parameter. This parameter specifies the space character (" ") to divide the string whenever a space is present. A separator is used to join an array ...

Read More

Why addEventListener to 'select' element does not work in JavaScript?

Yaswanth Varma
Yaswanth Varma
Updated on 18-Jan-2023 9K+ Views

When a user changes the value of an element, the , , and elements fire the change event. The change event does not always fire for every change to an element's value, unlike the input event. Instead, use querySelector() along with addEventListener(). Let’s discuss one by one to understand how they will work. The addEventListener() Method − The addEventListener() is a method used to register an event handler for the specified event type on the current element. It allows you to specify a function that will be called whenever the specified event occurs on the element. Following ...

Read More

How to convert a currency string to a double with jQuery or JavaScript?

Yaswanth Varma
Yaswanth Varma
Updated on 18-Jan-2023 3K+ Views

If you are working with currency values in your web application, it is important to convert them from a string representation into an actual numerical value. In this article, we will discuss how to do this using both jQuery and JavaScript. We will look at the different methods available for converting strings to doubles. There are two popular ways to convert currency string into float string using different JavaScript inbuilt libraries. Let’s look into the following article to understand more about how to convert a currency string to a double with jQuery or JavaScript. This is a straightforward way in ...

Read More

Detecting arrow key presses in JavaScript?

Yaswanth Varma
Yaswanth Varma
Updated on 18-Jan-2023 20K+ Views

In this article we are going to learn about detecting arrow key presses in JavaScript. Before we jump into the article, let’s discuss few things to know some information. There is a distinct key code for each key on the keyboard. Here, we'll check to see if the arrow key has been pressed. There are four arrow keys on our keyboard. On our keyboard, we can see, the left, right, up, and download keys. These keys also have a special key code that JavaScript can utilise to determine whether, or not they have been depressed. The key codes for the ...

Read More

How to get the entire document HTML as a string in JavaScript?

Yaswanth Varma
Yaswanth Varma
Updated on 18-Jan-2023 2K+ Views

One of the most useful features of JavaScript is the ability to get an entire document's HTML as a string. This can be used for many purposes, such as obtaining data from a website or creating dynamic content on your own website. In this article, we'll go over how to get the entire document HTML as a string in JavaScript. To get the entire document HTML as a string, use the concept of innerHTML The dynamic html can be written on the html document using the innerHTML property. The majority of the time, it is used in web pages to ...

Read More

Remove element by id in JavaScript?

Yaswanth Varma
Yaswanth Varma
Updated on 18-Jan-2023 7K+ Views

The Remove Element By Id In JavaScript method is a powerful tool for manipulating the DOM (Document Object Model). It allows you to remove elements from the page by their id. This can be useful when removing unwanted elements or creating dynamic content on the fly. The syntax is simple, and this article will explain how to use it in more detail. In order to make a website interactive, JavaScript provides it with a number of functionalities. Removing a node or an element from a web page is one of the most fundamental features offered by JavaScript. Let's go over ...

Read More

ES6/ECMA6 template literals not working in JavaScript?

Yaswanth Varma
Yaswanth Varma
Updated on 18-Jan-2023 1K+ Views

Template literals are a powerful and useful feature of the ECMAScript 6 (ES6) JavaScript language. However, there may be times when template literals do not work properly in your code. This article will discuss some common issues you may encounter with template literals, as well as potential solutions for resolving them. Additionally, we'll provide an overview of what template literals are and how they can be used to create more efficient and readable code. Template literals were known as template strings prior to ES6. Template literals are surrounded by the backtick (' ') character as opposed to quotes in ...

Read More
Showing 2201–2210 of 6,517 articles
« Prev 1 219 220 221 222 223 652 Next »
Advertisements