Articles on Trending Technologies

Technical articles with clear explanations and examples

Create editable content in an HTML document

Bhanu Priya
Bhanu Priya
Updated on 15-Mar-2026 1K+ Views

The contenteditable attribute in HTML allows users to directly edit content on a webpage. This creates interactive elements that behave like text editors within the browser. Syntax The contenteditable attribute can be applied to any HTML element: Values true - Makes the element editable by the user false - Prevents the element from being edited (default behavior) Basic Example Here's a simple demonstration of editable vs non-editable content: Editable Content Demo This content is editable. Click here ...

Read More

Chrome input type="number" CSS styling

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 15-Mar-2026 2K+ Views

Chrome provides special CSS pseudo-elements to style the spinner arrows in input type="number" fields. You can hide them completely or customize their appearance. Hiding the Number Input Spinner To completely remove the spinner arrows from number inputs: input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; } input[type=number] { ...

Read More

Why HTML5 Web Workers are useful?

Anvi Jain
Anvi Jain
Updated on 15-Mar-2026 280 Views

JavaScript was designed to run in a single-threaded environment, meaning multiple scripts cannot run at the same time. Consider a situation where you need to handle UI events, query and process large amounts of API data, and manipulate the DOM. JavaScript will hang your browser in situations where CPU utilization is high. Let us take a simple example where JavaScript goes through a big loop: Big for loop function bigLoop(){ for (var i = 0; i

Read More

Set image for bullet style with CSS

Chandu yadav
Chandu yadav
Updated on 15-Mar-2026 636 Views

The list-style-image CSS property allows you to replace default bullet points with custom images, giving you complete control over list styling. Syntax list-style-image: url('path/to/image.png'); list-style-image: none; /* Default */ Basic Example Here's how to set a custom bullet image for an unordered list: .custom-bullets { list-style-image: url('/images/arrow-bullet.png'); } ...

Read More

Remove elements from a PriorityQueue using Javascript

karthikeya Boyini
karthikeya Boyini
Updated on 15-Mar-2026 452 Views

Dequeuing elements from a PriorityQueue means removing the element with the highest priority. Since we store elements with the highest priority at the end of the array, we can simply pop it to dequeue it. Priority Queue Structure World Priority: 2 Hello Priority: 3 Foo Priority: 8 Highest Priority ...

Read More

How can I trigger an onchange event manually in javascript?

Ayush Gupta
Ayush Gupta
Updated on 15-Mar-2026 28K+ Views

In JavaScript, you can manually trigger an onchange event using the dispatchEvent() method with a custom Event object. This is useful for programmatically simulating user interactions. Basic Setup First, let's create an input element with a change event listener: document.querySelector('#test').addEventListener('change', () => { console.log("Changed!"); }); Method 1: Using Event Constructor Create a new Event object and dispatch it on the target element: Trigger Change document.querySelector('#example1').addEventListener('change', () => { console.log("Change event fired!"); }); function triggerChange1() { ...

Read More

Explain the finally Statement in JavaScript with examples.

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 304 Views

The finally statement in JavaScript always executes after try and catch blocks, regardless of whether an error occurred or not. This makes it ideal for cleanup operations and code that must run in all scenarios. Syntax try { // Code that may throw an error } catch (error) { // Handle error (optional) } finally { // Always executes } Example: Finally Block Always Executes ...

Read More

Implementation of Stack in JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 671 Views

A stack is a Last In First Out (LIFO) data structure where elements are added and removed from the same end, called the top. This article demonstrates how to implement a stack in JavaScript using a class-based approach with basic operations like push, pop, and display. What is a Stack? A stack follows the LIFO principle - the last element added is the first one to be removed. Think of it like a stack of plates where you can only add or remove plates from the top. Item 3 ...

Read More

How to check existence of NaN keyword in an array JavaScript

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 1K+ Views

We have an array of elements that contains both truthy and falsy values. Our job is to write a function that returns an array with indices of those elements which are NaN in the original array. NaN !== NaN The datatype of NaN is actually number. Although NaN is a falsy value, it has a peculiar property that no other datatype or variable has. It's that the expression NaN === NaN yields false. And it's only in the case of NaN that this is false. So, we can use this behavior to our advantage and pick out ...

Read More

Detecting HTML click-to-call support in JavaScript

Ankith Reddy
Ankith Reddy
Updated on 15-Mar-2026 367 Views

The tel: protocol enables click-to-call functionality on mobile devices. Most modern browsers support it, but older devices may require different protocols or detection methods. Basic tel: Protocol Support Modern mobile browsers support the tel: protocol natively: Click to Call Example Call +1 (234) 567-890 // Check if tel: links are supported function isTelSupported() { ...

Read More
Showing 17621–17630 of 61,299 articles
Advertisements