HTML DOM Input Password name Property

AmitDiwan
Updated on 16-Mar-2026 21:38:54

208 Views

The HTML DOM Input Password name property is used for setting or returning the name attribute of an input password field. The name attribute helps in identifying the form data after it has been submitted to the server. JavaScript can also use the name attribute to reference form elements for manipulation. Syntax Following is the syntax for setting the name property − passwordObject.name = name Following is the syntax for getting the name property − var name = passwordObject.name Parameters The name parameter is a string that specifies the ... Read More

How to make a display in a horizontal row?

Saba Hilal
Updated on 16-Mar-2026 21:38:54

1K+ Views

Displaying HTML elements in a horizontal row is a common layout requirement in web development. There are several CSS techniques to achieve this, including display: inline, display: inline-block, display: flex, and using HTML table structures. This article demonstrates three different approaches to create horizontal layouts. CSS Display Properties for Horizontal Layout The most common CSS properties for horizontal arrangement are − display: inline − Elements flow horizontally but cannot have width/height set display: inline-block − Elements flow horizontally and can have dimensions display: flex − Modern flexible layout method with powerful alignment options HTML tables − ... Read More

Design a table using table tag and its attributes

Yaswanth Varma
Updated on 16-Mar-2026 21:38:54

559 Views

The HTML tag is used to create structured data displays in rows and columns. Combined with various table attributes like border, cellpadding, cellspacing, and background styling, you can design professional-looking tables for presenting data on web pages. Tables are essential for displaying comparative data, financial reports, schedules, and any information that benefits from a structured grid layout. The table structure uses several nested tags to organize content effectively. Syntax Following is the basic syntax for the HTML tag − Header 1 ... Read More

HTML DOM KeyboardEvent key Property

AmitDiwan
Updated on 16-Mar-2026 21:38:54

150 Views

The KeyboardEvent key property returns the identifier of the key that was pressed during a keyboard event. This property provides the actual value of the key, making it useful for detecting specific characters, special keys, and modifiers in web applications. Syntax Following is the syntax for accessing the key property − event.key Where event is the KeyboardEvent object passed to the event handler function. Return Value The key property returns a string representing the key that was pressed. The returned values include − Printable characters − Letters, numbers, symbols (e.g., ... Read More

HTML DOM KeyboardEvent keyCode Property

AmitDiwan
Updated on 16-Mar-2026 21:38:54

149 Views

The KeyboardEvent keyCode property returns the numeric unicode character code for the key that was pressed during a keyboard event. This property has been deprecated in favor of the key property, but it is still widely used in legacy code and remains functional across browsers. Note − The keyCode property is deprecated. Use the key property instead for more accurate and readable results in modern applications. Syntax Following is the syntax for accessing the keyCode property − event.keyCode The event.keyCode returns a numeric value representing the key that was pressed. For example, the ... Read More

How can I vertically center a div element for all browsers using CSS?

AmitDiwan
Updated on 16-Mar-2026 21:38:54

1K+ Views

To vertically center a div element for all browsers using CSS, there are several reliable methods. The most modern and widely supported approach is using Flexbox, which provides complete control over alignment and works consistently across all modern browsers. Vertical centering has historically been challenging in CSS, but modern layout methods like Flexbox and CSS Grid have made it straightforward. We'll explore multiple techniques to ensure compatibility across different browser versions and use cases. Method 1: Using Flexbox (Recommended) Flexbox is the most reliable method for vertical centering. It works in all modern browsers and provides excellent ... Read More

Advantages and Disadvantages of HTML

Yaswanth Varma
Updated on 16-Mar-2026 21:38:54

2K+ Views

The language used to create web pages is known as HTML (Hypertext Markup Language). It is a markup language rather than a programming language. Hypertext is text that contains an embedded link to another web page or website. HTML is used to lay the foundation and structure of a webpage, serving as the backbone of all websites you visit. Every web developer has to learn HTML to begin with. HTML5 is the most recent and most advanced version of HTML. Together with CSS3, it performs fantastically. If you're considering studying this language, you should be aware of its advantages ... Read More

HTML DOM KeyboardEvent location Property

AmitDiwan
Updated on 16-Mar-2026 21:38:54

191 Views

The HTML DOM KeyboardEvent location property returns a numeric value indicating the physical location of the pressed key on the keyboard. This property helps distinguish between keys that have the same keyCode but exist in different locations, such as left and right Shift keys. Syntax Following is the syntax for accessing the location property − event.location Return Values The property returns one of four possible numeric values representing different keyboard sections − Value Description 0 Standard keys (most keys on the keyboard including letters, numbers, ... Read More

How can I vertically align elements in a div?

AmitDiwan
Updated on 16-Mar-2026 21:38:54

6K+ Views

Vertically aligning elements within a div is a common requirement in web development. There are several effective methods to achieve perfect vertical alignment, each suitable for different scenarios and content types. Methods for Vertical Alignment We can vertically align elements in a div using any of the following approaches − Flexbox − Modern and most flexible approach Position property − Traditional method with absolute positioning Line-height property − Best for single-line text content Padding property − Simple method using equal top and bottom padding CSS Grid − Powerful layout method for complex alignments Using ... Read More

HTML DOM KeyboardEvent metaKey Property

AmitDiwan
Updated on 16-Mar-2026 21:38:54

170 Views

The HTML DOM KeyboardEvent metaKey property returns a Boolean value indicating whether the meta key was pressed during a keyboard event. The meta key corresponds to the Cmd key on Mac and the Windows key on Windows systems. This property is commonly used to detect keyboard shortcuts that involve the meta key, such as Cmd+C for copy on Mac or Windows+R for the Run dialog on Windows. Syntax Following is the syntax for accessing the metaKey property − event.metaKey Return Value The metaKey property returns a Boolean value − true ... Read More

Advertisements