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
HTML DOM Input Text name Property
The HTML DOM Input Text name property is used for setting or returning the name attribute of an input text field. The name attribute helps in identifying form data after it has been submitted to the server and is essential for form processing. Syntax Following is the syntax for setting the name property − textObject.name = "name" Following is the syntax for getting the name property − var name = textObject.name Here, textObject is a reference to the input text element, and name is a string specifying the name attribute ...
Read MoreHow to save HTML Tables data to CSV in Python
Extracting data from HTML tables and saving it to CSV format is a common task in data science and web scraping. When dealing with multiple tables on a webpage, manual copy-paste becomes impractical, making automated extraction essential. This tutorial demonstrates how to use Python libraries like csv, urllib, and BeautifulSoup to scrape HTML table data and convert it to CSV format efficiently. Required Libraries Before starting, ensure you have the necessary libraries installed − pip install beautifulsoup4 The csv and urllib= len(tables): ...
Read MoreHTML DOM Input Text object
The HTML DOM Input Text object represents an element with type="text" in the Document Object Model. This object provides properties and methods to dynamically create, access, and manipulate text input fields using JavaScript. We can create an Input Text object using createElement() and access existing text inputs using getElementById() or other DOM selection methods. Syntax Following is the syntax for creating an Input Text object − var inputElement = document.createElement("INPUT"); inputElement.setAttribute("type", "text"); Following is the syntax for accessing an existing Input Text object − var inputElement = document.getElementById("textFieldId"); ...
Read MoreHow to set float input type in HTML5?
HTML5 does not include a specific float input type, but there are effective ways to create input fields that accept floating-point (decimal) numbers. This is commonly needed for forms that collect data like CGPA scores, prices, measurements, or any numeric values requiring decimal precision. What is Float Input? A float or floating-point number is a number that contains a decimal point, such as 3.14, 9.75, or 100.50. Float inputs are essential when precision beyond whole numbers is required, such as in financial calculations, scientific measurements, or academic grading systems. Approaches to Set Float Input Type While ...
Read MoreHTML onafterprint Event Attribute
The HTML onafterprint event attribute is triggered when a page has started printing or if the print dialog box has been closed in the HTML document. This event is useful for restoring page styles or displaying messages after the print operation is completed. Syntax Following is the syntax for the onafterprint event attribute − The script parameter contains JavaScript code or a function call that executes after printing occurs. Parameters The onafterprint event attribute accepts the following parameter − script − A JavaScript function or code that runs when ...
Read MoreHTML DOM Input Text placeholder property
The HTML DOM Input Text placeholder property is used for setting or returning the placeholder attribute value of an input text field. The placeholder property provides a hint to users about the expected input by displaying greyed-out text inside the input field before any user input. Unlike the value property, placeholder text is not submitted with the form data. Syntax Following is the syntax for setting the placeholder property − textObject.placeholder = "text" Following is the syntax for getting the placeholder property − var placeholderText = textObject.placeholder Here, text represents ...
Read MorePrint elements that can be added to form a given sum
This program finds and prints elements from a given array that can be added together to form a specified sum. The algorithm uses a greedy approach where it iterates through the array and selects elements that don't exceed the remaining sum value. Algorithm The greedy algorithm works as follows − START STEP 1 → Take number of elements and array values from user STEP 2 → Take the target sum from user STEP 3 → For i = 0 to n-1 STEP 4 → If (current_sum - array[i]) >= 0 then ...
Read MoreHTML DOM Input Text required property
The HTML DOM Input Text required property is associated with the required attribute of an element. This property allows you to set or check whether a text field must be filled before form submission. When a required field is left empty, the browser prevents form submission and displays a validation message. Syntax Following is the syntax for setting the required property − textObject.required = true|false Following is the syntax for getting the required property − var isRequired = textObject.required; Property Values The required property accepts boolean values − ...
Read MoreHTML DOM small object
The HTML DOM small object represents the HTML element in the Document Object Model. The element is used to display text in a smaller font size, typically for disclaimers, copyright notices, or fine print. Through the DOM, we can dynamically create, access, and manipulate small elements using JavaScript. Syntax Following is the syntax for creating a small object − var smallElement = document.createElement("SMALL"); Following is the syntax for accessing an existing small element − var smallElement = document.getElementById("smallId"); Creating a Small Element The createElement("SMALL") method creates a ...
Read MoreHow to group related elements in a form using HTML?
When designing forms for websites, grouping related elements together significantly improves user experience and form accessibility. Proper grouping helps users understand the form structure, navigate more efficiently, and reduces completion errors. HTML provides several semantic methods to achieve effective form grouping. What is Form Element Grouping? Form element grouping involves organizing related form controls such as radio buttons, checkboxes, and input fields into logical sections. This creates visual and semantic relationships between elements, making forms more intuitive and accessible to all users, including those using screen readers. HTML offers several semantic approaches for grouping form elements, with ...
Read More