Member-only story
7 HTML Attributes to Help You Improve User Experience
🔒 HTML is a powerful language used to create web pages. While most developers are familiar with commonly used HTML attributes, there are some lesser-known attributes that provide additional functionality and enhance the user experience. In this article, we’ll explore 7 such HTML attributes that you probably didn’t know about yet. 🔍
🔤 1. enterkeyhint property of the virtual keyboardenterkeyhint
is a new attribute of the HTML <input>
tag. This attribute affects the style and behavior of the enter keys of the virtual keyboard. It is mainly used on devices such as mobile terminals and tablets, so that users can clearly know what action the enter key will perform. Typical values for this attribute are "enter", "done", "go", "next", "previous", "search", and "send". 📱
🔎 For example, if you use the attribute in a search box enterkeyhint="search"
, when the user uses the search box on a mobile device, the enter key will change to "Search" and the user will be able to submit the search by clicking this key. 🔍
📝
`<form action="/search">
<input type="text" enterkeyhint="search" name="q">
<input type="submit" value="Search">
</form>`
In this example, the input…