शब्दकोश · वेब डेवलपमेंट

HTML Attribute

An HTML attribute is a name-value pair inside an element's start tag that configures the element, such as href on a link or alt on an image.

अपडेट: अक्टूबर 6, 2026

An HTML attribute is extra information written inside an element's opening tag as a name and usually a value, like class="nav" or src="photo.jpg". Attributes configure behavior, identity and accessibility of the element.

Why it matters

Attributes drive much of the web: href creates links, src loads resources, alt describes images for screen readers and id and class connect elements to CSS and JavaScript. Some are boolean, such as disabled, and are active by their mere presence. Wrong or missing attributes cause broken links, failed loads and accessibility gaps.

Example

<img src="/img/logo.png" alt="SiteDownCheck logo" width="120" height="40">
<input type="email" name="email" required>

The image has four attributes. The input uses required, a boolean attribute with no value.

Common mistakes

  • Writing disabled="false". Any presence of a boolean attribute turns it on.
  • Leaving out alt on meaningful images.
  • Using the same id on more than one element in a page.

Get notified when this term updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.