Articles on Trending Technologies

Technical articles with clear explanations and examples

How can I make a div with irregular shapes with CSS3 and HTM5?

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

With CSS3, you can create various shapes including rectangles, triangles, circles, and more complex irregular shapes using properties like border-radius, transform, and clip-path. Basic Shapes Rectangle A simple rectangle is created using width and height properties: #rectangle { width: 300px; height: 150px; background: blue; } Triangle Triangles are created using border properties with transparent sides: #triangle { width: 0; height: 0; ...

Read More

Bootstrap Labels

Samual Sam
Samual Sam
Updated on 15-Mar-2026 298 Views

Labels are great for offering counts, tips, or other markups for pages. Bootstrap provides the .label class to create inline labels that complement text content. Basic Label Syntax Use the .label class along with contextual classes to create different styled labels: Default Primary Success Example Here's a complete example showing labels used with headings to display counts: Bootstrap Labels Example ...

Read More

Basic Operations supported by a list in Javascript

Samual Sam
Samual Sam
Updated on 15-Mar-2026 367 Views

JavaScript arrays (lists) support several fundamental operations that allow you to manipulate and access data efficiently. Here are the core operations you can perform on arrays. Basic List Operations Insertion − Add elements at the beginning, middle, or end of the list Deletion − Remove elements from any position in the list Display − Show the complete list contents Search − Find elements using specific values or conditions Access − Retrieve elements by their index position Insertion Operations You ...

Read More

How to terminate javascript forEach()?

Ayush Gupta
Ayush Gupta
Updated on 15-Mar-2026 666 Views

You can't break from the forEach method and it doesn't provide a way to escape the loop (other than throwing an exception). However, there are several alternative approaches to achieve early termination when iterating over arrays. The Problem with forEach The forEach() method is designed to iterate through all array elements. Unlike traditional loops, it doesn't support break or continue statements: // This will NOT work - break is not allowed in forEach [1, 2, 3, 4].forEach((element) => { console.log(element); if (element === 2) { ...

Read More

How to check if an object is an instance of a Class in JavaScript?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 571 Views

In JavaScript, you can check if an object is an instance of a specific class using the instanceof operator. This operator returns true if the object was created by the specified constructor function or class. Syntax object instanceof Constructor Using instanceof with Constructor Functions Instance Check Example CHECK INSTANCE function Student(name, age, standard) { this.name = name; this.age = age; this.standard = standard; } let student1 = new Student("Rohan", ...

Read More

JavaScript code for recursive Fibonacci series

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 469 Views

We have to write a recursive function fibonacci() that takes in a number n and returns an array with first n elements of fibonacci series. The Fibonacci sequence starts with 0 and 1, where each subsequent number is the sum of the two preceding ones. Understanding the Fibonacci Sequence The Fibonacci sequence follows this pattern: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34... where F(n) = F(n-1) + F(n-2). Recursive Implementation Here's a recursive approach that builds the Fibonacci array: const fibonacci = (n, res = [], count = 1, last = ...

Read More

Display in console if Select list value contains a value from an array in JavaScript?

AmitDiwan
AmitDiwan
Updated on 15-Mar-2026 780 Views

In JavaScript, you can check if a selected dropdown value exists in an array using event listeners and array methods. This is useful for validation or conditional logic based on user selections. HTML Structure Let's start with a basic dropdown containing several names: John David Chris Mike Bob Carol Array to Check Against We'll define an array of names to compare with the selected value: ...

Read More

How to return a random number between 0 and 199 with JavaScript?

Rama Giri
Rama Giri
Updated on 15-Mar-2026 555 Views

To return a random number between 0 and 199, use the JavaScript Math.random() and Math.floor() methods together. How It Works Math.random() generates a random decimal between 0 (inclusive) and 1 (exclusive). To get integers from 0 to 199: Multiply by 200 to get range 0 to 199.999... Use Math.floor() to round down to nearest integer Example // Generate random number between 0-199 let randomNum = Math.floor(Math.random() * ...

Read More

How to set the brightness and contrast of an image with JavaScript?

Sharon Christine
Sharon Christine
Updated on 15-Mar-2026 4K+ Views

JavaScript provides the CSS filter property to adjust image brightness and contrast dynamically. You access these filters through the style.filter property on image elements. Syntax element.style.filter = "brightness(value) contrast(value)"; Parameters Filter Default Value Range Effect brightness() 100% 0% to 200%+ 0% = black, 100% = normal, 200% = very bright contrast() 100% 0% to 200%+ 0% = gray, 100% = normal, 200% = high contrast Example: Interactive Brightness and Contrast Click below to change the brightness ...

Read More

Touchmove pointer-events: none CSS does not work on Chrome for Android 4.4 / ChromeView

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 15-Mar-2026 380 Views

The pointer-events: none CSS property doesn't work properly on Chrome for Android 4.4 (ChromeView) for touchmove events. This causes issues when trying to disable touch interactions on overlay elements. The Problem On Chrome for Android 4.4, elements with pointer-events: none still receive touchmove events, breaking the expected behavior where these elements should be non-interactive. Solution: Using touchstart with preventDefault() Instead of relying on CSS pointer-events: none, use JavaScript to handle and prevent touch events: Overlay Content const overlay = document.getElementById('overlay'); // Prevent all touch interactions overlay.addEventListener('touchstart', function(ev) ...

Read More
Showing 17691–17700 of 61,299 articles
Advertisements