Found 8894 Articles for Front End Technology

How to create previous and next button and non-working on end position using JavaScript?

Shubham Vora
Updated on 28-Feb-2023 16:39:53

6K+ Views

There are many ways to create previous and next button and non-working on-end positions using JavaScript. We will cover two approaches to achieve this functionality - one using normal if conditions and the other using the "disabled" attribute. The second approach utilizes the "disabled" attribute to make the button not clickable and updates the button style for nonworking end positions. By implementing these techniques, we can easily navigate through a set of elements, making the user experience more seamless and intuitive. Let’s see both methods with examples for creating this kind of button in JavaScript. Using only if conditions ... Read More

How to create own Ajax functionality?

Shubham Vora
Updated on 28-Feb-2023 16:38:20

226 Views

An Ajax (Asynchronous JavaScript and XML) request is an HTTP request made using JavaScript, typically with the XMLHttpRequest object, to exchange data with a server and update a specific part of a web page without requiring full page refresh. There are two ways to create own Ajax functionality. You can use JSONPlaceholder API or your own file. We will discuss these two ways in detail in this tutorial. Using JSONPlaceholder API JSONPlaceholder is a free online REST API that you can use to test and practice your development skills Syntax Users can follow the below syntax for creating an ... Read More

How to show Page Loading div until the page has finished loading?

Shubham Vora
Updated on 28-Feb-2023 16:36:29

10K+ Views

Rather than showing the whole white or black screen while loading the page, it is better to show the loading indicator, which also improves the UX of the application. Nowadays, there are some libraries available to show loading indicators. However, we can use HTML and CSS to create a customized loading indicator div. In this tutorial, we will use HTML, CSS, and JavaScript to show page loading div until the page has finished loading Use the onreadystatechange event to show the loading indicator while loading the page In JavaScript, the onreadystatechange event triggers whenever the state of the web ... Read More

How to serialize a cookie name-value pair into a Set Cookie header string in JavaScript?

Shubham Vora
Updated on 28-Feb-2023 16:34:55

795 Views

The cookie allows us to store users’ data in the web browser for quick response. For example, when a user opens the profile page in any web application, the web page receives the data from the server. The server also sends the cookies containing the data to store in the web browser. When a user goes on the profile page again, it fetches the data from the cookie rather than fetching it from the server to load the webpage quickly. To get data browser looks in the cookie first, and if it doesn’t find data stored in the cookie, it ... Read More

How to check an element with specific id exist using JavaScript?

Aman Gupta
Updated on 27-Feb-2023 16:04:18

4K+ Views

Overview To check for a specific id in a HTML element to attain a certain task can be achieved with help of JavaScript. So to achieve the solution to the problem, we should have knowledge about how to access the HTML Document Object Model (DOM). So the HTML element that is specified with an id name can be accessed by the document object, which contains several methods from which we will be using the getElementById() method. Syntax The basic syntax used is − document.getElementById() document −In the given syntax, the document is the object that is loaded when ... Read More

How to check an element exist or not in jQuery?

Aman Gupta
Updated on 27-Feb-2023 16:14:52

3K+ Views

Overview We can check for an HTML element such as , , etc that they exist in the HTML page or not using jQuery. To achieve the solution, we have the "length" property of jQuery, which checks the specific element in the HTML document and returns the length of the particular element, which is the number of times that element is present in the HTML body. The length property is present in the jQuery ($) main library. Syntax The syntax used in this program is − $(elementName).length; elementName −The elementName can be any tag, class name, id name ... Read More

How to check an array is empty or not using jQuery?

Aman Gupta
Updated on 27-Feb-2023 16:16:34

5K+ Views

Overview In jQuery, we can easily check whether an array is empty or not by using multiple methods. The collective way includes length property and as in JavaScript arrays are the object so using the jQuery alias symbol $.isEmptyObject(objName). An array is a collection of elements. So to achieve our goal, we should have some prior knowledge about the syntax of jQuery and how to manipulate the HTML. It is necessary to write the “$” with isEmptyObject() method as “$” is the main library of the jQuery which contains various method as isEmptyObject(), isArray(), isFunction() and many more. In all ... Read More

How to check a URL contains a hash or not using JavaScript?

Aman Gupta
Updated on 27-Feb-2023 15:53:16

663 Views

Overview To check whether a Uniform Resource Locator (U.R.L.) contains a hash (#text) or not with JavaScript, as JavaScript contains some pre-build methods which makes a straightforward task to obtain a certain goal. This can be done by using the hash property in JavaScript, which can be accessed by initializing the window.location object. It eases the user-interface and provides a foremost navigation through the web page. To build this solution, we need prior knowledge on the following topics − HTML- To build the skeleton of the page. In which we will use an internal tag. HTML Events (onclick(), ... Read More

How to position absolute rendering the button in a new line?

Devesh Chauhan
Updated on 27-Feb-2023 15:00:18

1K+ Views

If you wish to control how an element is to be positioned in a web page, we have to make use of the position CSS property. The properties that define the position of an element in document are essential, its top, left, bottom, and right properties and position is a shorthand property that can be used to set all four of these. The possible values that we can use with position property are specified below − Static − The element is placed in accordance with the document's natural flow. No difference is made by the top, right, bottom, ... Read More

How to display text Right-to-Left Using CSS?

Devesh Chauhan
Updated on 27-Feb-2023 14:58:57

2K+ Views

CSS (Cascading Style Sheets) is a style sheet language that is mainly used to style and describe the elements of HTML documents. One of the main features of this programming language is the separation of elements and presentation such as layers, colors, etc. CSS is used to style all HTML tags, including the document's body, headings, paragraphs, and other pieces of text. CSS can also be used to style the display of table elements, grid elements, and images. The main difference between these two programming languages is that HTML (Hypertext Markup Language) is a language used to describe ... Read More

Advertisements