Content · Web Development · HTML

HTML HTML Enumerated Attributes: Valid Values and Missing Defaults

Some attributes choose between a defined set of keywords instead of behaving like true/false switches. The browser follows a missing-value default or an invalid-value default defined for that particular...

1 views Published Oct 19, 2026 Updated Oct 19, 2026 Admin

Some attributes choose between a defined set of keywords instead of behaving like true/false switches. The browser follows a missing-value default or an invalid-value default defined for that particular attribute.

What You Need to Know


For instance, contenteditable="true" requests editing, while draggable="false" explicitly turns dragging off. Do not guess that every unknown value simply becomes false.

Some attributes accept a defined list of values. An unknown value may trigger a default rather than becoming a new custom option.

The goal is not to collect as many tags as possible. Pick the element that best describes what the content really is.

Example: See It in Action


Add this example to the appropriate part of a practice HTML page. Read each line before you open the page in your browser.

This is a short HTML fragment. To try it as a webpage, put it inside the body element of a complete HTML document.

<p contenteditable="true">You can edit this paragraph.</p>
<p dir="auto">A message can choose its direction.</p>
<p draggable="false">Dragging is turned off here.</p>

Let’s Understand the Example


  • A p groups a paragraph of related text. Start another paragraph for a new thought.
  • Dir tells the browser which direction the text runs.

Look for the text “You can edit this paragraph.” in the page. If the visible result surprises you, inspect the rendered elements to see what the browser actually built.

What Should You See?


The page should include “You can edit this paragraph.”. If it looks different from what you expected, open developer tools and compare the source with the elements the browser created.

Try removing one piece of markup in a scratch copy, refresh the page, and compare the behavior. This is often the fastest way to understand what that piece contributes.

Try It Yourself


  1. Change contenteditable="true" to "false" and try typing into the paragraph.
  2. Save your changes, open or refresh the page, and compare the result with the original example.
  3. Tell a friend what your change did. If you are not sure, undo it, refresh the page, and compare.

Common Beginner Mistakes


  • Treating an enumerated attribute like a Boolean attribute that works by presence alone.
  • Avoid picking tags just for their default bold, italic or spaced appearance. Use CSS for presentation.

Key Takeaways


  • Some attributes choose between a defined set of keywords instead of behaving like true/false switches.
  • A p groups a paragraph of related text. Start another paragraph for a new thought.
  • Some attributes accept a defined list of values. An unknown value may trigger a default rather than becoming a new custom option.
Share this resourceSend this page to someone who may find it useful.