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 by karthikeya Boyini
Page 32 of 143
HTML DOM Select disabled Property
The HTML DOM select disabled property is used to get or set whether a dropdown list is disabled or enabled. When a select element is disabled, users cannot interact with it, and it appears grayed out in most browsers. Syntax Following is the syntax for getting the disabled property − object.disabled Following is the syntax for setting the disabled property − object.disabled = true | false Return Value The disabled property returns a Boolean value − true − The select element is disabled false ...
Read MoreHTML DOM Select length Property
The HTML DOM select length property returns the number of elements inside a drop-down list. This read-only property is useful for dynamically counting options in a select element without manually iterating through them. Syntax Following is the syntax for the select length property − selectObject.length Return Value The length property returns a number representing the total count of elements within the select element. If no options are present, it returns 0. Example − Basic Usage Following example demonstrates how to get the number of options in a select element ...
Read MoreHTML DOM Select type Property
The HTML DOM Select type property is a read-only property that returns the type of form control for a select element. For HTML elements, this property always returns "select-one" for single-selection dropdowns or "select-multiple" for multi-selection lists. Syntax Following is the syntax for accessing the type property − selectObject.type Return Value The type property returns a string value − "select-one" − For single-selection dropdown lists (default behavior) "select-multiple" − For multi-selection lists (when multiple attribute is present) Example − Single Selection Dropdown Following example demonstrates the type ...
Read MoreHTML DOM Select size Property
The HTML DOM select.size property returns and modifies the value of the size attribute of a dropdown list. This property controls how many options are visible at once in the select element without scrolling. Syntax Following is the syntax for returning the size value − selectObject.size Following is the syntax for setting the size value − selectObject.size = number Parameters The size property accepts the following parameter − number − A positive integer that specifies how many options should be visible in the dropdown list without scrolling. ...
Read MoreHTML5 Canvas layer disappears on mouse click in Fabric.js and Firefox stops responding when creating a canvas for the image?
When working with HTML5 Canvas and Fabric.js, you may encounter two common issues: the canvas layer disappearing on mouse click and Firefox becoming unresponsive when creating a canvas for images. These problems often occur due to improper event handling and canvas initialization. Let us explore solutions to resolve these issues. Common Canvas Issues The main problems developers face include − Canvas layer disappearing − This happens when event listeners conflict or when the canvas is not properly initialized. Firefox freezing − This occurs when large images are loaded without proper optimization or when infinite loops are ...
Read MoreHow to use small font in HTML?
To create small font text in HTML, use the CSS font-size property with the style attribute. Since HTML5 deprecated the tag, CSS is the modern standard for controlling font sizes. You can specify font size in various units like pixels (px), em, rem, or percentages. The inline style attribute overrides any global styles defined in external CSS files or within tags in the document head. Syntax Following is the syntax for setting small font using inline CSS − Content Where value can be specified in pixels (px), em units, rem units, ...
Read MoreHTML5 Canvas and select / drag-and-drop features in a JS library?
HTML5 Canvas provides excellent drawing capabilities for creating shapes, text, and curves. However, by default, canvas elements don't support traditional DOM events like onClick or drag-and-drop functionality. To add interactive features like drag-and-drop to canvas-based graphics, developers often use JavaScript libraries that provide these capabilities. One popular solution is Raphael.js, a cross-browser vector graphics library that uses SVG for modern browsers and VML for older versions of Internet Explorer. This library allows you to create interactive vector graphics with built-in support for drag-and-drop events, touch events, and mouse interactions. How Raphael.js Works Raphael.js creates vector graphics that ...
Read MoreHow do I get an address latitude-longitude using HTML5 Geolocation or Google API?
The HTML5 Geolocation API provides a way to access the user's geographic location, including latitude and longitude coordinates. This requires JavaScript to interact with the browser's geolocation services and can be enhanced with Google's Geocoding API for reverse geocoding (converting coordinates to addresses). HTML5 Geolocation Syntax Following is the basic syntax for accessing geolocation − navigator.geolocation.getCurrentPosition(successCallback, errorCallback, options); Parameters successCallback − Function called when location is successfully retrieved errorCallback − Function called when an error occurs (optional) options − Configuration object for timeout, accuracy, and caching (optional) Getting Latitude and ...
Read MoreAnimating canvas to infinitely animate the noise to give the appearance of movement in HTML
Canvas animation using putImageData() allows you to directly manipulate pixel data for creating dynamic visual effects. By continuously generating and displaying new pixel data in a loop, you can create smooth animated effects like moving noise patterns. Syntax Following is the basic syntax for animating canvas with putImageData() − context.putImageData(imageData, dx, dy); Where imageData is the ImageData object containing pixel data, and dx, dy are the destination coordinates on the canvas. How Canvas Noise Animation Works The animation technique involves creating an ImageData object outside the animation loop for performance optimization. Inside ...
Read MoreUsing client side XSLT transformations in HTML5
Client-side XSLT transformations allow you to convert XML data into HTML directly in the browser using JavaScript's XSLTProcessor API. This is useful for displaying XML data in a formatted way without server-side processing. Browser Support The XSLTProcessor API is supported by most modern browsers, including Chrome, Firefox, Safari, and Edge. Android 4.0+ and iOS 2.0+ also support XSLT transformations. Basic Syntax const processor = new XSLTProcessor(); processor.importStylesheet(xslDocument); const result = processor.transformToFragment(xmlDocument, document); Complete Example Here's a working example that transforms XML book data into HTML: ...
Read More