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
How to set style display of an html element in a selenium test?
We can set the style display of an HTML element with Selenium WebDriver using JavaScript execution. The DOM interacts with page elements through JavaScript, and Selenium executes JavaScript commands using the executeScript method. This approach is particularly useful when you need to modify CSS properties like visibility, display type, or other styling attributes programmatically during test execution. Some operations like setting the style display must be performed by JavaScript Executor. The getElementById method locates the element, then we apply the style.display property to set the display type such as block, none, inline, or flex. Syntax Following is ...
Read MoreHow Would I Crop A HTML IFrame?
An iframe (Inline Frame) is an HTML element that embeds another document within the current HTML page. Sometimes you need to crop an iframe to show only a specific portion of the embedded content, hiding unwanted sections like headers, footers, or sidebars. Cropping an iframe involves using CSS positioning and overflow properties to control which part of the embedded content is visible. This technique is useful when you want to display only a specific section of a webpage without showing the entire page. Syntax Following is the basic syntax for HTML iframe − ...
Read MoreHTML Window length Property
The HTML Window length property returns the number of elements (frames) in the current window or document. This property is read-only and provides a count of all frame elements present in the current context. Syntax Following is the syntax for the Window length property − window.length Return Value The window.length property returns a number representing the total count of iframe elements in the current document. If no iframes are present, it returns 0. Example − Single Iframe Following example demonstrates the Window length property with one iframe element − ...
Read MoreHTML DOM UiEvent detail Property
The HTML DOM UiEvent detail property returns a number that indicates how many times a mouse button was clicked in rapid succession. This property is particularly useful for detecting single clicks, double clicks, triple clicks, and other consecutive click patterns. Note − The detail property returns 2 for double-click events, 3 for triple-click events, and always 0 for mouse events that don't involve clicking such as onmouseover or onmouseout. Syntax Following is the syntax for accessing the detail property − event.detail Return Value The detail property returns an integer representing the number ...
Read MoreHow to display a popup message when a logged-out user tries to vote?
In this article, we will learn how to display a popup message when a logged-out user tries to vote using jQuery and various JavaScript methods. This is a common requirement in web applications where certain actions like voting, commenting, or rating should be restricted to authenticated users only. To implement this functionality, we will use the jQuery library along with HTML and CSS to create interactive popup messages. When an unauthenticated user attempts to vote, we will show an informative popup that prompts them to log in first. Syntax Following is the basic syntax for checking user ...
Read MoreHTML DOM Input Radio type property
The HTML DOM Input Radio type property returns the type attribute value of an input radio element. Since this property is associated with radio input elements, it always returns "radio" as a string value. Syntax Following is the syntax for accessing the radio type property − radioObject.type Return Value The type property returns a string representing the type of the input element. For radio buttons, this will always be "radio". Example Following example demonstrates how to get the type property of a radio input element − ...
Read MoreHow to add section that is quoted from another source using HTML?
A quote is a text element that is used to indicate a quotation or a passage of text that is being referenced or cited from another source. HTML provides two main elements for creating quotes: the tag for longer, block-level quotations and the tag for shorter, inline quotations. Syntax Following is the syntax for the element − Quoted text content Author, Source Title Following is the syntax for the element − Short quoted text Using the Blockquote Element ...
Read MoreHTML Navigator product Property
The navigator.product property in HTML is a read-only property that returns the browser's engine name. In modern browsers, this property typically returns "Gecko" regardless of the actual browser engine being used. Syntax Following is the syntax for the navigator product property − navigator.product Return Value The property returns a string representing the browser engine name. For compatibility reasons, most modern browsers return "Gecko" even if they don't use the Gecko engine. Example Following example demonstrates how to access the navigator product property − ...
Read MoreHow to add HTML and CSS to PDF?
In this tutorial, we will learn how to convert HTML and CSS content to PDF using JavaScript libraries. Creating PDFs from web content allows users to save styled webpages, forms, reports, or any HTML content as downloadable documents. Converting HTML and CSS to PDF from scratch using vanilla JavaScript is complex and requires extensive coding. Fortunately, several JavaScript libraries simplify this process by providing easy-to-use methods for generating PDFs from web content. We will explore two popular libraries − html2pdf.js and jsPDF − both of which can convert styled HTML content into PDF documents directly in the browser. ...
Read MoreHow To Select Divs That Has A Specific HTML Content That Matches Values?
The div tag is one of the most fundamental HTML elements used to create content divisions and sections on web pages. When building dynamic web applications, you often need to select specific div elements based on their HTML content or attribute values for styling, manipulation, or interaction purposes. This article demonstrates various methods to select div elements that contain specific HTML content or match particular values using CSS selectors, JavaScript, and HTML attributes. Method 1 - Using JavaScript to Select Divs by Text Content JavaScript provides powerful methods to traverse the DOM and select elements based on ...
Read More