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 Ankith Reddy
Page 15 of 73
How to set whether the dragged data is copied, moved, or linked, when dropped in HTML?
The dropzone attribute in HTML5 was designed to specify how dragged data should be handled when dropped on an element. It defines whether the dropped data should be copied, moved, or linked to its original location. Syntax Following is the syntax for the dropzone attribute − Parameters The dropzone attribute accepts the following values − copy − The drop will create a copy of the dragged element at the target location. move − The dragged element will be moved from its original location to the new target location. link − ...
Read MoreHow to get materialize CSS checkbox to work with @Html.CheckBoxFor?
When using Materialize CSS with ASP.NET MVC's Html.CheckBoxFor helper, you may encounter issues where checkboxes disappear or don't display properly. This happens because Html.CheckBoxFor generates both a visible checkbox and a hidden input field, which can interfere with Materialize CSS styling. The Problem The Html.CheckBoxFor helper in ASP.NET MVC automatically creates two input elements − A visible checkbox input A hidden input with the same name to ensure a value is always submitted This hidden input can cause Materialize CSS checkbox styling to break, making checkboxes appear misaligned or disappear entirely. Solution Using ...
Read MoreApplying 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 MoreHTML5 semantic elements and which old browsers does it support?
HTML5 introduced semantic elements that provide meaning to the structure of web content. These elements like , , , , and describe their content's purpose rather than just its appearance. However, older browsers, particularly Internet Explorer 8 and earlier versions, do not recognize these new semantic elements. What are HTML5 Semantic Elements? HTML5 semantic elements are tags that clearly describe their meaning in a human and machine readable way. Unlike generic and elements, semantic elements convey the purpose of the content they contain. Common HTML5 Semantic Elements − Contains introductory content ...
Read MoreHTML DOM activeElement Property
The HTML DOM activeElement property is a read-only property that returns the currently focused element in the document. This property is useful for tracking user interaction and determining which element has keyboard focus at any given time. When no specific element has focus, the activeElement property typically returns the element or the element, depending on the browser. Syntax Following is the syntax for the activeElement property − document.activeElement Return Value The activeElement property returns an Element object representing the currently focused element in the document. If no element has focus, ...
Read MoreHTML autocomplete Attribute
The autocomplete attribute in HTML controls whether the browser should automatically fill in form fields based on previously entered values. When set to on, browsers provide suggestions from the user's input history, making form completion faster and more convenient. Syntax Following is the syntax for the autocomplete attribute − For individual form controls, the syntax is − Parameters The autocomplete attribute accepts the following values − on − Enables autocomplete for the form or input element. The browser will suggest previously ...
Read MoreHow to display deleted text in HTML?
The tag in HTML is used to display deleted text by marking it with a strikethrough. This semantic element indicates that the content has been removed from the document but is kept visible to show revision history or changes made to the content. Syntax Following is the syntax for the tag − Deleted text Attributes The tag supports the following specific attributes − Attribute Value Description cite URL Specifies a URL to a document that explains why the text was deleted. ...
Read MoreExecute a script when the media has started playing in HTML?
The onplaying attribute in HTML is used to execute a JavaScript function when an audio or video element starts playing. This event is triggered after the media has been paused and is resumed, or when it starts playing for the first time. Syntax Following is the syntax for using the onplaying attribute − ... ... The onplaying attribute can also be used with JavaScript event listeners − element.addEventListener('playing', functionName); Using onplaying with Video Element Example Following example demonstrates how to execute a script when a video starts playing ...
Read MoreIs their a negative lookbehind equivalent in JavaScript?
JavaScript supports negative lookbehind assertions in modern environments (ES2018+), but older browsers require workarounds using character classes and capturing groups. Modern Negative Lookbehind (ES2018+) ES2018 introduced native negative lookbehind syntax (?: let text = 'He said "hello" and she said "goodbye"'; let result = text.replace(/(? breaks down as: (^|[^\]) — Captures either start of string OR any character except backslash " — Matches the quote to replace $1' — Replaces with the captured character plus single quote Browser Compatibility Comparison Method Browser Support Performance Native (? Chrome ...
Read MoreWorld Map on HTML5 Canvas or SVG
Creating interactive world maps in web browsers can be accomplished using SVG with libraries like Raphael.js or using HTML5 Canvas. This tutorial demonstrates both approaches for rendering world maps. Using SVG with Raphael.js Raphael.js is a JavaScript library that simplifies working with vector graphics in web browsers. Here's how to get started: // Create Raphael paper (canvas) var paper = Raphael("world-map", 800, 400); // Drawing basic shapes for map elements var circle = paper.circle(50, 40, 10); circle.attr("fill", "#f00"); circle.attr("stroke", "#fff"); // Create a simple country shape using path var country ...
Read More