Loop through an array in JavaScript

This article will be very helpful if you are learning the JavaScript programming language and trying to write a custom code that manipulates or reads data in the Arrays. A very common case in web development is that you need to iterate over some items in the array and perform a desired action, for example, …

Remove specific item from an array in JavaScript

The JavaScript is a very powerful programming language and provides a great support for arrays. There are many different language constructs available that you can use to remove item from an array. This article contains description of only the most popular ways to modify an array, but you can extend and improve them to meet …

How to redirect to another web page in JavaScript

This article contains information on how to redirect to another page in a programmatic way. This method has both advantages and disadvantages and we will discuses them in detail. Custom client side redirections are useful in situations when you make a web application and the active page must be changed due to some conditions. For …

What is the correct JSON content type?

If you are in a process of making custom web application and you need to send some data to the client, it may be necessary to set proper media type for the content. This is usually a case when you have to transmit arrays, objects, or any sort of attribute-value pairs of data. As result, …

How to select an element by name in jQuery

It's very easy to select element by name in jQuery, please take a look at the following HTML code snippet: There are input elements with the name attribute set to "first-name", "last-name", "email" values. This is a good example of a simple user registration form and is a very popular case in web development. Now, …

How to detect which radio button is selected

Hello, if you need to detect which radio element is selected, then this article may help. We will show how to get value of the selected radio button from the group of such elements in your HTML form. For the beginning, we will use jQuery framework since it's very popular and easy to use solution. …