Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
Applying a CSS style to an ID element when the beginning of its name stays identical and the end varies in HTML
When you need to apply CSS styles to multiple HTML elements that have IDs with a common beginning but different endings, CSS attribute selectors provide an efficient solution. This technique is particularly useful for dynamically generated content where IDs follow a consistent naming pattern. Syntax Following is the syntax for selecting elements with IDs that begin with a specific value − element[id^="prefix"] { /* CSS properties */ } Following is the syntax for selecting elements with IDs that contain a specific substring − element[id*="substring"] { ...
Read MoreWhat are start angle and end angle of arc in HTML5 canvas?
The arc() method in HTML5 Canvas creates circular arcs and full circles. The startAngle and endAngle parameters define which portion of the circle to draw, measured in radians from the positive x-axis. Syntax Following is the syntax for the arc() method − arc(x, y, radius, startAngle, endAngle, anticlockwise) Parameters The arc() method accepts the following parameters − x, y − Coordinates of the circle's center point radius − The radius of the circle in pixels startAngle − Starting angle in radians, measured from the positive x-axis endAngle − Ending angle in ...
Read MoreHow to limit maximum items on multiple input ()?
The multiple attribute in HTML allows users to select multiple files or email addresses in input fields. However, HTML alone cannot limit the number of items selected. To restrict the maximum number of files or entries, you need to use JavaScript validation. Syntax Following is the syntax for the multiple attribute − The multiple attribute is a boolean attribute that enables selection of multiple values. It works with file and email input types. Using Multiple Attribute with File Input The multiple attribute allows users to select several files simultaneously from ...
Read MoreGetting values from HTML5 Canvas to JavaScript
When working with HTML5 Canvas, it's important to understand that the canvas element acts as a bitmap drawing surface that doesn't retain information about individual drawn objects. Once something is drawn on the canvas, it becomes part of a flat image and cannot be individually accessed or manipulated through JavaScript. Why Canvas Doesn't Store Object Data The HTML5 Canvas is fundamentally different from DOM elements. It operates as an immediate mode graphics API, meaning it draws pixels directly to a bitmap surface without maintaining a scene graph or object hierarchy. This design makes canvas extremely fast for rendering ...
Read MoreExecute a script when the seeking attribute is set to true indicating that seeking is active in HTML?
The onseeking event attribute in HTML is triggered when the user starts seeking (moving to a different position) in an audio or video element. This event fires when the seeking process begins, before the media actually jumps to the new position. Syntax Following is the syntax for the onseeking event attribute − The onseeking attribute accepts a JavaScript function that executes when the seeking operation starts. This is commonly used to provide user feedback or track user interactions with media content. How It Works When a user drags the progress ...
Read MorePull down to refresh on the mobile web browser in HTML.
The pull-to-refresh functionality is a common mobile interaction pattern where users can pull down on a webpage to refresh its content and fetch the latest updates. This feature can be implemented on mobile web browsers using JavaScript, touch events, and AJAX requests. Pull-to-refresh acts as a trigger for XMLHttpRequest (XHR) calls in AJAX, allowing new data to be dynamically loaded into specific page elements without requiring a full page reload. Implementation Approaches Using Custom JavaScript Scrolling Pull-to-refresh can be implemented using custom JavaScript scrolling mechanisms like iScroll. Popular platforms such as Twitter use iScroll for their ...
Read MoreHow to draw a circular gradient in HTML5?
HTML5 Canvas provides the createRadialGradient() method to create circular or radial gradients. This method returns a CanvasGradient object that represents a radial gradient painting along a cone defined by two circles. The gradient transitions smoothly from the inner circle to the outer circle, creating a circular gradient effect. Syntax Following is the syntax for the createRadialGradient() method − createRadialGradient(x0, y0, r0, x1, y1, r1) Parameters The createRadialGradient() method accepts six parameters that define two circles − Parameter Description x0 x-coordinate of the starting circle's center ...
Read MoreWhat is the correct way of using , , or in HTML?
The HTML element creates a line break in text content. There are several correct syntaxes for using the br tag, depending on the document type you're working with. Understanding the differences helps ensure proper cross-compatibility. Syntax Following are the valid syntaxes for the br element − The element is a void element, meaning it has no content and does not require a closing tag. The space before the forward slash in ensures compatibility with older HTML parsers. HTML5 Syntax In modern ...
Read MoreExecute a script when the element gets user input in HTML?
The oninput event attribute is used to execute a script when an element receives user input. This event fires immediately when the user types, deletes, or modifies content in form elements like text inputs, textareas, and content-editable elements. Syntax Following is the syntax for the oninput event attribute − Where script is the JavaScript code to execute when the input event occurs. How It Works The oninput event triggers whenever the value of an input element changes. Unlike onchange, which fires only when the element loses focus, oninput fires in real-time ...
Read MoreCan we delete the "getContext" property of HTML5 Canvas tag through script?
The getContext property of the HTML5 Canvas element is a built-in method that provides access to the drawing context. While the HTML5 specification doesn't explicitly address deletion of the getContext property through JavaScript, it is technically possible to delete this property from the prototype chain. When we delete the getContext method, all canvas elements lose their ability to create drawing contexts, effectively rendering them non-functional for graphics operations. Syntax Following is the syntax to delete the getContext property − delete window.HTMLCanvasElement.prototype.getContext; Following is the syntax to check if the property has been deleted ...
Read More