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 on Trending Technologies
Technical articles with clear explanations and examples
Which HTML tags are self-closing?
HTML contains specific tags that are self-closing, meaning they do not require a separate closing tag. These tags represent elements that contain no content between opening and closing tags, such as line breaks, images, and form inputs. Self-closing tags end with a slash before the closing angle bracket () in XHTML, though the slash is optional in HTML5. Complete List of Self-Closing Tags HTML5 defines the following self-closing (void) elements − - Image map clickable areas - Base URL for relative links ...
Read MoreHTML DOM HashChangeEvent
The HTML DOM HashChangeEvent is an interface that represents events fired when the hash portion (fragment identifier) of a URL changes. This event occurs when the part of the URL after the # symbol is modified, either programmatically through JavaScript or by user interaction with anchor links. The HashChangeEvent is commonly used in single-page applications (SPAs) for client-side routing and navigation without full page reloads. Syntax Following is the syntax for accessing HashChangeEvent properties − event.newURL event.oldURL The event is typically handled using the onhashchange event handler − window.addEventListener('hashchange', function(event) { ...
Read MoreHTML DOM MouseEvent clientX Property
The HTML DOM MouseEvent clientX property returns the horizontal coordinate (x-axis position) of the mouse pointer relative to the visible area of the web browser when a mouse event occurs. The coordinate is measured in pixels from the left edge of the browser's client area, excluding scrollbars, toolbars, and other browser interface elements. Syntax Following is the syntax for accessing the clientX property − MouseEventObject.clientX Return Value The clientX property returns a number representing the horizontal pixel coordinate of the mouse pointer. The value is always relative to the current viewport, not the ...
Read MoreHow to Emphasize Text in a Document using HTML5?
Text may be emphasized in documents using a variety of HTML5 elements to highlight crucial information and make it easier for readers to identify important content. HTML5 provides both presentational and semantic elements for text emphasis, each serving different purposes in document structure and meaning. Different tags are used in HTML like , , , , , , , , and to emphasize text, add superscript and subscript formatting, and provide semantic meaning to content. Syntax Following are the syntax patterns for common text emphasis elements − bold text italic text underlined text strongly ...
Read MoreWhich is better for HTML editing, Coda or Espresso?
The choice between Coda and Espresso for HTML editing depends on individual preferences and specific requirements. Coda is a versatile and feature-rich editor with a sleek interface, offering a wide range of tools for HTML, CSS, and JavaScript development. It includes built-in file management, FTP support, and collaboration features. On the other hand, Espresso is known for its simplicity and speed, providing a streamlined editing experience with focused features for web development. It offers powerful code-editing capabilities and integration with popular web technologies. Note: Both Coda and Espresso are legacy macOS editors that are no longer actively developed. Coda ...
Read MoreHTML DOM Input Text autocomplete Property
The HTML DOM Input Text autocomplete property controls whether a text input field should have autocomplete functionality enabled or disabled. This property is associated with the autocomplete attribute of an element with type="text". The autocomplete feature allows browsers to automatically fill in text fields based on values the user has entered previously. This improves user experience by reducing typing effort for commonly entered data like names, addresses, and email addresses. Syntax Following is the syntax for setting the autocomplete property − textObject.autocomplete = "on|off" Following is the syntax for getting the autocomplete ...
Read MoreHTML DOM MouseEvent offsetX Property
The HTML DOM MouseEvent offsetX property returns the horizontal (x) coordinate of the mouse pointer relative to the target element when a mouse event is triggered. It represents the distance in pixels from the left edge of the element to the mouse cursor position. Syntax Following is the syntax for accessing the offsetX property − MouseEventObject.offsetX Return Value The offsetX property returns a number representing the horizontal coordinate of the mouse pointer relative to the target element's left edge, measured in pixels. How It Works The offsetX property calculates the mouse ...
Read MoreHow to Add Date and Time Picker using only one tag in HTML?
Incorporating date and time pickers into web forms is a common requirement for many web developers. While you might think that adding date and time pickers requires JavaScript libraries, HTML5 provides a simple, native solution. Using the input element with the datetime-local type, you can create a combined date and time picker with just one tag, significantly reducing code complexity. Syntax Following is the syntax for creating a combined date and time picker − The tag is an interactive element in HTML whose main purpose is to take different forms of inputs ...
Read MoreHow to remove the space between inline/inline-block elements in HTML?
When using inline-block elements in HTML, unwanted whitespace often appears between them due to how browsers render whitespace in the HTML markup. This space comes from line breaks, spaces, and tabs between elements in your HTML code. There are several effective methods to remove this spacing. Understanding the Problem The space between inline-block elements occurs because browsers treat whitespace characters (spaces, tabs, line breaks) in HTML as actual content. When elements are displayed as inline-block, this whitespace becomes visible as gaps between the elements. Example − Inline-block Elements with Space Let us first see how the ...
Read MoreWhich of the following is not a valid HTML tag: h1, H, h2, h3?
HTML uses specific tags to structure and organize content on web pages. Understanding which tags are valid and which are not is crucial for proper HTML development. The question asks about the validity of four potential heading tags: h1, H, h2, and h3. HTML Tag Syntax HTML tags follow a specific syntax structure enclosed in angle brackets − Content Valid HTML tags must have defined names in the HTML specification. Tag names are case-insensitive, meaning and are equivalent. HTML Heading Tags HTML provides six levels of heading tags to create ...
Read More