Found 8895 Articles for Front End Technology

How to disable browser Autocomplete on the web form field/input tag?

Dishebh Bhayana
Updated on 02-Aug-2023 19:07:28

176 Views

In this article, we will learn how to disable the browser autocomplete feature on the web form fields or their input elements, and we will use the “autocomplete” attributes provided by “form” and “input” HTML tags. Browser autocomplete is a feature that suggests the past values entered and submitted into the forms. By default, autocomplete is enabled in the browsers, and so when the user clicks on an input, the suggestions are visible for that input value, and the user can directly pick any of the suggestions to autofill the content. To disable this behavior, we will see ... Read More

How to disable arrows from Number input?

Dishebh Bhayana
Updated on 02-Aug-2023 19:01:20

13K+ Views

In this article, we will learn how to disable and hide arrows from number-type input with the help of 2 different approaches, one using CSS, and the other using an “inputmode” attribute. Number-type inputs are useful when we only want inputs in terms of numbers from users, like input for age, height, weight, etc. By default, the browsers show arrows in the number-type inputs that help us change (increase or decrease) the values in the input. Let’s understand how to implement above with the help of some examples. Example 1 In this example, we will use HTML readonly attribute ... Read More

How to disable the ALT key using jQuery?

Dishebh Bhayana
Updated on 02-Aug-2023 18:58:05

211 Views

In this article, we will learn how to disable the ALT key using jQuery with the help of “keydown” and “keyup” event listeners, and the bind method. In web development, there might be scenarios where you want to disable certain keys on your web page. One such key is the ALT key, which is often used in combination with other keys to trigger specific actions or shortcuts. However, in certain cases, disabling the ALT key may be necessary to ensure the proper functioning of the application. Let’s understand this with the help of some examples − Example 1 In ... Read More

How to Test a URL for 404 error in PHP?

Pradeep Kumar
Updated on 17-Aug-2023 18:02:27

1K+ Views

PHP: PHP (Hypertext Preprocessor) is a widely-used open-source server-side scripting language that is specifically designed for web development. It was originally created by Rasmus Lerdorf in 1994 and has since evolved into a powerful language used by millions of developers worldwide. PHP is primarily used to develop dynamic web pages and web applications. It allows developers to embed PHP code within HTML, making it easy to mix server-side logic with the presentation layer. PHP scripts are executed on the server, and the resulting HTML is sent to the client's browser. To test a URL for a 404 error ... Read More

Sort an alphanumeric string such that the positions of alphabets and numbers remain unchanged

Sonal Meenu Singh
Updated on 01-Aug-2023 09:43:27

690 Views

Introduction In this tutorial, we introduce an approach to sorting an alphanumeric string such that the position of alphabets and numbers remains unchanged. In this approach, we use C++ functions and take an input string containing characters and numbers. Generate the string without changing the alphabet and number positions. The newly sorted string contains the shuffled characters in alphabetical order, and arranging the numbers will keep their positions the same. Example 1 String = “”tutorials43points” Output = aiilnoopr34sstttu In the above example, the input string is rearranged without changing the position of the number 32. The characters are ... Read More

How to fix property not existing on EventTarget in TypeScript?

Rushi Javiya
Updated on 01-Aug-2023 19:52:01

5K+ Views

TypeScript is an open-source language that provides optional static typing for JavaScript. It allows developers to write more maintainable code by catching type-related errors at compile-time rather than runtime. However, working with event listeners in TypeScript can be a bit tricky. One common issue is the "property not existing on EventTarget" error. This error occurs when you try to access a property on an event target that TypeScript doesn't recognise. In this article, we will discuss how to fix this error and provide examples to demonstrate how to use event listeners in TypeScript. Understanding the Error Before we dive into ... Read More

How to add constraints to the generic types?

Rushi Javiya
Updated on 22-Aug-2023 12:06:11

284 Views

TypeScript is an open-source programming language that provides type annotations to JavaScript. TypeScript has generic types that enable developers to write code that can work with different data types. Generics provide flexibility and reusability in code. However, in some cases, it is necessary to add constraints to generic types to restrict the types that can be used with them. In this article, we will explain how to add constraints to generic types in TypeScript and we will also discuss some examples. What are Generic Types? Before we dive into constraints, let's first understand what generic types are. Generic types in ... Read More

How to get class properties and values using Typescript Reflection?

Rushi Javiya
Updated on 01-Aug-2023 16:07:14

3K+ Views

TypeScript is a superset of JavaScript that provides static typing capabilities, allowing developers to write more reliable and efficient code. One of the most powerful features of TypeScript is its support for reflection. Reflection enables TypeScript developers to inspect and manipulate the properties of classes at runtime, making it easier to write more flexible and dynamic code. In this article, we will explore how to use TypeScript reflection to get class properties and values. We will discuss what reflection is and how it works in TypeScript, provide a brief overview of TypeScript decorators, and then walk through three examples of ... Read More

TypeScript - Type erasure and error behaviour?

Rushi Javiya
Updated on 01-Aug-2023 16:06:14

149 Views

TypeScript is a popular programming language that offers features such as type checking and type annotations to help developers write more robust and maintainable code. However, when TypeScript code is compiled into JavaScript, the type information is lost in a process called type erasure. This can lead to errors at runtime that are difficult to diagnose and fix. In this article, we will explore the concept of type erasure in TypeScript and how it can affect error behaviour in our code. Type Erasure Type erasure is the process of removing type information from a program during compilation. In TypeScript, this ... Read More

TypeScript - Implicit Typing

Rushi Javiya
Updated on 22-Aug-2023 12:03:20

627 Views

TypeScript is a statically typed programming language that is a superset of JavaScript. It is used for large-scale web applications that require strict typing, object-oriented programming concepts, and code reusability. One of the most important features of TypeScript is the ability to infer types automatically. This feature is known as implicit typing. Implicit typing is a feature that allows TypeScript to automatically determine the type of a variable at the time of its initialisation. This makes coding faster, easier, and less error-prone. This article will explore the concept of implicit typing in TypeScript and discuss its benefits with examples. What ... Read More

Advertisements