George John

George John

789 Articles Published

Articles by George John

Page 19 of 79

Can you take a screenshot of the page using HTML5 Canvas?

George John
George John
Updated on 15-Mar-2026 711 Views

Html2Canvas is a JavaScript library that can take screenshots of web pages or specific elements. It doesn't capture actual screenshots but recreates the visual representation based on DOM information and CSS styles. How Html2Canvas Works The library reads the DOM structure and CSS properties to generate a canvas representation of the page. This approach works entirely in the browser without requiring server-side processing or special permissions. Basic Example Here's a complete example showing how to capture a screenshot of a specific container: ...

Read More

Play local (hard-drive) video file with HTML5 video tag?

George John
George John
Updated on 15-Mar-2026 1K+ Views

The HTML5 tag allows you to play local video files from the user's hard drive using JavaScript's File API and URL.createObjectURL() method. This technique works with MP4, WebM, and Ogg video formats. HTML Structure Create a file input and video element: Local Video Player Your browser does not support the video tag. ...

Read More

Are there any style options for the HTML5 Date picker?

George John
George John
Updated on 15-Mar-2026 2K+ Views

The HTML5 date picker provides a native calendar interface for date selection. While browsers implement their own default styling, you can customize the appearance using CSS pseudo-elements, particularly for WebKit-based browsers like Chrome and Safari. Basic Date Picker Structure The HTML5 date input creates a structured date picker with separate fields for month, day, and year, plus a calendar dropdown indicator. HTML5 Date Picker Styling Basic Date Picker Styling the Date Picker Container ...

Read More

HTML5 Cross Browser iframe post message - child to parent?

George John
George John
Updated on 15-Mar-2026 243 Views

HTML5's postMessage API enables secure communication between an iframe and its parent window across different domains. This is essential for cross-origin iframe communication where traditional methods fail due to browser security policies. Parent Window Setup The parent window needs to set up an event listener to receive messages from the child iframe. Here's the cross-browser compatible approach: Parent Window Parent Window ...

Read More

img-rounded Bootstrap class

George John
George John
Updated on 15-Mar-2026 348 Views

Use the img-rounded Bootstrap class to style your image and give it rounded corners. This class applies CSS border-radius to create smooth, rounded edges on images. Syntax Example Bootstrap Images Styling Images with Bootstrap ...

Read More

LCM of an array of numbers in Java

George John
George John
Updated on 15-Mar-2026 4K+ Views

L.C.M. or Least Common Multiple of two values, is the smallest positive value which is a multiple of both values. For example, multiples of 3 and 4 are: 3 → 3, 6, 9, 12, 15 ... 4 → 4, 8, 12, 16, 20 ... The smallest common multiple is 12, hence the LCM of 3 and 4 is 12. Understanding LCM of Array To find the LCM of an array of numbers, we can use the mathematical relationship: LCM(a, b) = (a × b) / GCD(a, b). For multiple numbers, we calculate LCM iteratively. ...

Read More

Is it required to have a return a value from a JavaScript function?

George John
George John
Updated on 15-Mar-2026 2K+ Views

In JavaScript, functions do not require a return statement. The return statement is optional, and functions can operate without explicitly returning a value. Functions Without Return Values When a function doesn't have a return statement, it automatically returns undefined: function greetUser(name) { console.log("Hello, " + name + "!"); // No return statement } let result = greetUser("Alice"); console.log("Function returned:", result); Hello, Alice! Function returned: undefined Functions With Return Values Functions can explicitly return values using the return statement: function ...

Read More

CSS speak-as Speech Media property

George John
George John
Updated on 15-Mar-2026 166 Views

The CSS speak-as property is part of the Speech Media module and controls how text should be rendered by speech synthesizers. It determines whether text should be spoken normally, spelled out letter by letter, or treated as digits. Syntax selector { speak-as: value; } Possible Values ValueDescription autoDefault behavior based on content type normalSpeaks the text normally spell-outSpells out text letter by letter digitsSpeaks numbers as individual digits literal-punctuationSpeaks punctuation marks literally no-punctuationIgnores punctuation when speaking Example: Spell-Out Text The following example makes abbreviations spell out ...

Read More

CSS voice-duration Speech Media property

George John
George John
Updated on 15-Mar-2026 257 Views

The CSS voice-duration property is used to control the duration of speech synthesis when synchronizing speech with other media elements. This property is part of CSS Speech Module and helps in creating timed audio presentations. Syntax selector { voice-duration: value; } Possible Values ValueDescription autoUses the natural duration based on inherited voice-rate (default) timeSpecifies exact duration using time units (s, ms) Example: Setting Speech Duration The following example sets a specific duration for speech synthesis − ...

Read More

CSS nav-down property

George John
George John
Updated on 15-Mar-2026 257 Views

The CSS nav-down property defines which element should receive focus when the user presses the down arrow key. This property is part of CSS spatial navigation, designed primarily for TV remotes and game controllers where users navigate using directional keys. Syntax selector { nav-down: target; } Possible Values ValueDescription autoBrowser determines the next element (default) idID of the element to focus when down arrow is pressed inheritInherits the value from parent element Example: Creating Navigation Grid The following example creates a grid of buttons where pressing ...

Read More
Showing 181–190 of 789 articles
« Prev 1 17 18 19 20 21 79 Next »
Advertisements