HTML Articles

Page 5 of 151

How to Only Allow Numbers in a Text Box using jQuery?

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 14K+ Views

We can easily allow only numbers in a textbox using jQuery. This is useful for form validation and ensures users can only enter numeric values in specific input fields. We will explore two different approaches to achieve this functionality. Allow Only Numbers in a TextBox using jQuery replace() method Allow Only Numbers in a TextBox using jQuery fromCharCode() method Method 1: Using jQuery replace() with keyup Event This method uses the keyup event to filter out non-numeric characters after they are typed. It uses a regular expression with the replace() method to remove any character ...

Read More

How to Close Browser Tabs With a Keyboard Shortcut?

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 4K+ Views

Keyboard shortcuts provide a quick and efficient way to close browser tabs without using the mouse. These shortcuts are universal across all major web browsers and can significantly improve your browsing productivity. Universal Keyboard Shortcuts The following keyboard shortcuts work across all major browsers including Chrome, Firefox, Safari, Edge, and Opera − Windows and Linux To close the current active tab − Ctrl+W To close the entire browser window (all tabs) − Ctrl+Shift+W Mac To close the current active tab − Command+W To close the entire browser window (all ...

Read More

How to disable autocomplete of an HTML input field?

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 424 Views

The autocomplete attribute in HTML controls whether the browser should automatically fill in form field values based on previously entered data. Setting autocomplete="off" disables this feature for enhanced privacy and security, particularly useful for sensitive fields like passwords or personal information. Syntax Following is the syntax for disabling autocomplete on an input field − To enable autocomplete explicitly − You can also disable autocomplete for an entire form − Disabling Autocomplete for Individual Fields The most common ...

Read More

How to turn off spell checking (grammar correction) for HTML form elements?

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 197 Views

The spellcheck attribute in HTML controls whether the browser's spell checking feature is enabled or disabled for text input fields. By default, most browsers enable spell checking on text inputs and textareas, showing red underlines for misspelled words. Syntax Following is the syntax for the spellcheck attribute − The spellcheck attribute accepts three values − true − Enables spell checking for the element false − Disables spell checking for the element default − Uses the browser's default spell check behavior Disabling Spell Check To disable spell checking ...

Read More

How to create a download link with HTML?

AmitDiwan
AmitDiwan
Updated on 16-Mar-2026 869 Views

To create a download link with HTML, you use the tag with the download attribute. This attribute forces the browser to download the linked file instead of navigating to it. The download attribute works for same-origin URLs and can specify a custom filename for the downloaded file. Syntax Following is the basic syntax for creating a download link − Download Text To specify a custom filename for the download − Download Text Basic Download Link The simplest download link uses just the download attribute without a value. The ...

Read More

Difference Between HTML and ASP.

Nitin Sharma
Nitin Sharma
Updated on 16-Mar-2026 2K+ Views

Both HTML and ASP are web development technologies widely used for creating web pages and applications. HTML focuses on structuring and presenting content in web browsers, while ASP enables server-side processing to create dynamic, interactive web applications. Understanding the fundamental differences between these technologies is essential for web developers to choose the right approach for their projects. What is HTML? HTML (HyperText Markup Language) is a client-side markup language used to create the structure and content of web pages. The term "HyperText" refers to hyperlinks that connect web pages, while "Markup Language" describes how tags define page ...

Read More

Content Spoofing

Sunidhi Bansal
Sunidhi Bansal
Updated on 16-Mar-2026 609 Views

Content Spoofing is a type of attack where malicious programmers present a fake website as legitimate to users through text injection or HTML injection. When web applications fail to properly validate user-supplied data, attackers can inject additional parameters that modify the displayed content, leading users to pages that appear authentic but are designed to steal sensitive information. Content spoofing attacks exploit insufficient input validation and output encoding in web applications. The attacker manipulates URL parameters or form data to alter the content displayed to users, creating convincing replicas of legitimate pages to harvest credentials, personal information, or financial data. ...

Read More

Accessing HTML source code using Python Selenium.

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 16-Mar-2026 4K+ Views

We can access HTML source code with Selenium WebDriver using two primary methods. The page_source method retrieves the complete HTML of the current page, while JavaScript execution allows us to access specific portions of the DOM, such as the body content. Syntax Following is the syntax for accessing HTML source using the page_source method − src = driver.page_source Following is the syntax for accessing HTML source using JavaScript execution − h = driver.execute_script("return document.body.innerHTML") Method 1: Using page_source Method The page_source method returns the complete HTML source code of ...

Read More

How to set style display of an html element in a selenium test?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 16-Mar-2026 3K+ Views

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 More

How to simulate pressing enter in html text input with Selenium?

Debomita Bhattacharjee
Debomita Bhattacharjee
Updated on 16-Mar-2026 838 Views

We can simulate pressing enter in HTML text input fields using Selenium WebDriver. The sendKeys method allows us to send key presses to web elements, including the Enter key. This is commonly used for form submissions, search operations, or triggering input validation. Syntax Following is the syntax to simulate pressing Enter using Selenium − element.sendKeys(Keys.ENTER); Alternatively, you can use Keys.RETURN which produces the same result − element.sendKeys(Keys.RETURN); Both Keys.ENTER and Keys.RETURN represent the same key press action and can be used interchangeably in Selenium automation. Required Import To ...

Read More
Showing 41–50 of 1,509 articles
« Prev 1 3 4 5 6 7 151 Next »
Advertisements