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 Smita Kapse
Page 3 of 39
What HTML5 tag should be used for filtering search results.
HTML5 provides semantic elements for organizing content, but there's no specific tag exclusively for filtering search results. The best approach is to use a combination of semantic elements with appropriate roles and structure. Recommended Structure for Search Filters Use the element with filter controls inside a for better semantics and accessibility: Search Results Filter Results ...
Read MoreWith JavaScript RegExp search a hexadecimal number character.
To find a hexadecimal number character with JavaScript Regular Expression, use the \x escape sequence followed by the two-digit hexadecimal value. Syntax \xdd Where dd represents the two-digit hexadecimal value (00-FF) of the character you want to match. Example: Searching for Hexadecimal Character The following example searches for hexadecimal number 53, which represents the character 'S': JavaScript Regular Expression ...
Read MoreDifference between MessageChannel and WebSockets in HTML5
WebSockets and MessageChannel are both HTML5 communication technologies, but they serve different purposes. WebSockets enable real-time communication between browser and server, while MessageChannel facilitates secure communication between different browsing contexts within the same application. WebSockets Overview WebSockets provide bidirectional communication between browser and server over a single persistent connection. They're ideal for real-time applications like chat systems, live updates, and gaming. // WebSocket connection to server const socket = new WebSocket('wss://example.com/socket'); socket.onopen = function(event) { console.log('WebSocket connected'); socket.send('Hello Server!'); }; socket.onmessage = function(event) { ...
Read MoreHow to turn a String into a JavaScript function call?
In JavaScript, you can dynamically call a function by converting a string containing the function name into an actual function call. This is useful when function names are determined at runtime. Using window Object (Browser) The most common method in browsers is using the window object to access globally defined functions: function myFunction(argument) { alert('My function ' + argument); } ...
Read MoreWhat is the difference between break and continue statements in JavaScript?
JavaScript provides two important control statements for modifying loop execution: break and continue. While both affect loop flow, they serve different purposes. break Statement The break statement is used to exit a loop completely, terminating the entire loop execution and transferring control to the statement immediately following the loop. Example var x = 1; document.write("Entering the loop"); ...
Read MoreWhich one is better to use for a JavaScript link, "#" or "javascript:void(0)"?
When creating JavaScript links that don't navigate to another page, developers often choose between "#" and "javascript:void(0)". Both prevent default navigation, but they behave differently and have distinct use cases. Understanding the Difference The "#" anchor creates a link to the top of the current page and adds a hash to the URL, while "javascript:void(0)" executes JavaScript that returns undefined, preventing any navigation without affecting the URL. Using "#" Hash Links The hash symbol creates an anchor link that jumps to the top of the page if no element with that ID exists: ...
Read MoreWhat is "function*" in JavaScript?
The function* declaration defines a generator function that returns a Generator object. Unlike regular functions, generators can pause execution with yield and resume later, making them powerful for controlling program flow and creating iterators. Syntax Generator functions can be declared with function* in three equivalent ways: function* myFunction() {} // or function *myFunction() {} // or function*myFunction() {} How Generator Functions Work When called, a generator function doesn't execute immediately. Instead, it returns a generator object with methods like next() to control execution step by step. Basic Example ...
Read MoreHow to position text to top left position on an image with CSS
To position text to the top left position on an image, use the position property with absolute positioning along with the top and left properties. The parent container must have position: relative to serve as the positioning reference. Syntax .container { position: relative; } .text-overlay { position: absolute; top: value; left: value; } Example The following example demonstrates how to position text at the top left corner of an image − ...
Read MoreSet how many columns an element should span across with CSS
The CSS column-span property allows an element to span across multiple columns in a multi-column layout. This is particularly useful for creating headings or other elements that should break the column flow. Syntax selector { column-span: value; } Possible Values ValueDescription noneThe element does not span across columns (default) allThe element spans across all columns Example: Heading Spanning All Columns The following example demonstrates how to make a heading span across all columns in a multi-column layout − ...
Read MoreRole of CSS flex-wrap property wrap-reverse value
The CSS flex-wrap property with wrap-reverse value allows flex items to wrap to new lines in reverse order. When flex items exceed the container width, they wrap from bottom to top instead of the default top to bottom behavior. Syntax .container { display: flex; flex-wrap: wrap-reverse; } Example The following example demonstrates how wrap-reverse wraps flex items in reverse order − .mycontainer { display: flex; ...
Read More