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 Anvi Jain
Page 2 of 43
Hidden Bootstrap class
To hide elements in Bootstrap, you can use visibility utility classes. Bootstrap provides several classes to control element visibility across different screen sizes and contexts. Bootstrap Hidden Classes Bootstrap offers different approaches to hide elements: .d-none - Completely removes the element from the document flow .visually-hidden - Hides visually but keeps accessible to screen readers .invisible - Makes element invisible but maintains its space Using .d-none Class The .d-none class completely hides an element by setting display: none: Bootstrap ...
Read MoreHow to draw sine waves with HTML5 SVG?
To draw sine waves with HTML5 SVG, you can use the element with cubic Bezier curves to closely approximate the smooth curves of a sine wave. This approach provides precise control over wave shape and amplitude. Basic Sine Wave Example Here's how to create a simple sine wave using SVG path with cubic Bezier approximation: SVG Sine Waves HTML5 SVG Sine Wave ...
Read MoreWhy HTML5 Web Workers are useful?
JavaScript was designed to run in a single-threaded environment, meaning multiple scripts cannot run at the same time. Consider a situation where you need to handle UI events, query and process large amounts of API data, and manipulate the DOM. JavaScript will hang your browser in situations where CPU utilization is high. Let us take a simple example where JavaScript goes through a big loop: Big for loop function bigLoop(){ for (var i = 0; i
Read MoreHow to set the page-break behavior inside an element with JavaScript?
Use the pageBreakInside property in JavaScript to control page-break behavior inside an element when printing. This property determines whether a page break should occur within an element's content. Note − The changes are only visible when printing or viewing the print preview. Syntax element.style.pageBreakInside = "value"; Property Values Value Description auto Allow page breaks inside the element (default) avoid Avoid page breaks inside the element if possible inherit Inherit from parent element Example: Setting Page Break Behavior Here's how to control ...
Read MoreHow to write a Regular Expression in JavaScript to remove spaces?
To remove spaces from strings in JavaScript, regular expressions provide a powerful and flexible solution. The most common approach uses the /\s/g pattern with the replace() method. Basic Syntax string.replace(/\s/g, '') Where: \s - matches any whitespace character (spaces, tabs, newlines) g - global flag to replace all occurrences '' - empty string replacement Example: Removing All Spaces var str = "Welcome to Tutorialspoint"; document.write("Original: " + str); // Removing all spaces var result = str.replace(/\s/g, ''); document.write("After removing spaces: " + result); ...
Read MoreConvert coordinates to a place name with HTML5
For this, use Google Maps API to perform reverse geocoding. Geocoding refers to translating a human-readable address into a location on a map. The process of doing the converse, translating a location on the map into a human-readable address, is known as reverse geocoding. Getting User Location with HTML5 First, we'll use HTML5 Geolocation API to get the user's current coordinates: function getUserLocation() { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition, showError); } else { ...
Read MoreWhat is the usage of onscroll event in JavaScript?
The onscroll event in JavaScript occurs when an element's scrollbar is being scrolled. This event is commonly used to create interactive features like scroll-triggered animations, infinite scrolling, or scroll position indicators. Syntax element.onscroll = function() { // Code to execute when scrolling }; // Or using addEventListener element.addEventListener('scroll', function() { // Code to execute when scrolling }); Basic Example Here's a simple example showing how to detect when a div element is scrolled: ...
Read MoreWhat is the difference between custom and built-in functions in JavaScript?
JavaScript functions are divided into two main categories: custom (user-defined) functions and built-in functions. Understanding the difference helps you leverage JavaScript's capabilities effectively. Custom Functions (User-Defined) Custom functions are created by developers to perform specific tasks. You define the logic, parameters, and return values according to your needs. Syntax function functionName(parameter1, parameter2) { // Your custom logic here return result; } Example: Custom Function Custom Function Example ...
Read MoreHTML5 preload attribute
The HTML5 preload attribute controls how much video or audio content should be loaded when the page loads, before the user plays the media. This helps optimize page loading performance and user experience. Syntax Preload Values Value Behavior Use Case none No data is loaded until user plays Save bandwidth, slow connections metadata Only duration, dimensions loaded Show video info without full download auto Entire media file is downloaded Media likely to be played immediately Example: No Preload ...
Read MoreHTML5 appcache with Safari causing cross-site css to not load correctly
HTML5 AppCache was designed to enable offline web applications by caching specific resources. However, Safari's strict implementation can cause cross-site CSS files to fail loading when not properly configured in the cache manifest. The Safari AppCache Issue Safari follows the AppCache standard more strictly than other browsers. When a cache manifest is present, Safari blocks any network requests to resources not explicitly listed in the manifest file, including cross-site CSS files. Understanding the Problem When you have a cache manifest like this: CACHE MANIFEST # Version 1.0 CACHE: /styles/main.css /scripts/app.js /index.html ...
Read More