HTML • Chapter 34 • Foundations to Production
Custom Data and Editable Content
Each topic contains substantial explanation, ten focused teaching examples, its own HTML code example, code reasoning, expected browser result, and practice.
34.1 data-* Attributes
data-* Attributes is part of the HTML structure covered in Chapter 34. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
For data-* Attributes, examine the element's permitted content, relevant attributes, semantic meaning, accessibility effect, and how it behaves when CSS or JavaScript is unavailable. In custom data and editable content, the markup should remain understandable as a document before presentation is added.
In Chapter 34, a reliable way to learn data-* Attributes is to write a small valid fragment, inspect the browser result and document outline, then test one incorrect or missing attribute. This makes the reason for each piece of markup visible instead of treating HTML as a collection of tags to memorize.
Concept in plain language
data-* Attributes is part of the HTML structure covered in Chapter 34. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
10 teaching examples
Example 1: Minimal markup
Create the smallest valid product description example that demonstrates data-* Attributes. Identify which part carries meaning and which parts are only supporting structure. This is Chapter 34, topic 1, example 1.
Example 2: Content variation
Change the text or resource used by data-* Attributes in the profile page. Confirm that the markup still describes the new content correctly instead of depending on the old wording. This is Chapter 34, topic 1, example 2.
Example 3: Missing-information test
Remove one important attribute or related element from the documentation page example using data-* Attributes. Explain what meaning, accessibility, navigation, or browser behavior is lost. This is Chapter 34, topic 1, example 3.
Example 4: Accessibility review
Read the event page example using the semantics of data-* Attributes. Check names, labels, landmarks, alternatives, focus behavior, and whether the content still makes sense without styling. This is Chapter 34, topic 1, example 4.
Example 5: Mobile review
Open the FAQ page markup containing data-* Attributes on a narrow screen. Ensure embedded content, long text, controls, and translated labels do not force the page wider than the viewport. This is Chapter 34, topic 1, example 5.
Example 6: RTL review
Translate the photo story into Arabic or Persian. Keep document text RTL where appropriate while URLs, code samples, numbers, and intentionally LTR fragments remain readable. This is Chapter 34, topic 1, example 6.
Example 7: Validation exercise
Run the support page fragment using data-* Attributes through an HTML validator. Fix invalid nesting, duplicate IDs, missing required attributes, or obsolete markup before adding extra features. This is Chapter 34, topic 1, example 7.
Example 8: Progressive-enhancement check
Use data-* Attributes in the dashboard shell so the core content remains useful before CSS and JavaScript load. Add enhancement only after the document structure is complete. This is Chapter 34, topic 1, example 8.
Example 9: SEO and semantics review
Inspect how data-* Attributes contributes to the meaning of the language page. Keep headings, links, metadata, and document regions consistent so crawlers and users receive the same primary content. This is Chapter 34, topic 1, example 9.
Example 10: Production review
Review data-* Attributes in the booking page for validity, accessibility, security-related attributes, performance hints, responsive behavior, localization, and maintainability. This is Chapter 34, topic 1, example 10.
HTML code example
<section id="data-attributes">
<h2>data-* Attributes</h2>
<p>This HTML fragment demonstrates the document structure for data-* Attributes.</p>
</section>Step-by-step code explanation
- Identify the element or attribute responsible for data-* Attributes.
- Read the markup from the outer document structure inward and verify that each child is allowed in its parent context.
- Check the semantic meaning and any accessibility relationship such as labels, alternatives, headings, captions, or landmarks.
- Open the fragment in a browser and compare the rendered result with the source instead of assuming visual appearance proves validity.
- Validate the markup and test responsive, RTL, and no-JavaScript behavior where they apply.
Expected browser result: The browser displays or exposes the structure appropriate for data-* Attributes while preserving the semantic relationships expressed by the markup.
Practice exercise
Write a fresh HTML fragment for data-* Attributes in Chapter 34. Validate it, remove one important attribute or related element to observe the difference, then restore the correct markup. Test the result with keyboard navigation when interactive, on a narrow screen, and in Arabic or Persian when the content can be translated.
34.2 contenteditable
contenteditable is part of the HTML structure covered in Chapter 34. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
For contenteditable, examine the element's permitted content, relevant attributes, semantic meaning, accessibility effect, and how it behaves when CSS or JavaScript is unavailable. In custom data and editable content, the markup should remain understandable as a document before presentation is added.
In Chapter 34, a reliable way to learn contenteditable is to write a small valid fragment, inspect the browser result and document outline, then test one incorrect or missing attribute. This makes the reason for each piece of markup visible instead of treating HTML as a collection of tags to memorize.
Concept in plain language
contenteditable is part of the HTML structure covered in Chapter 34. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
10 teaching examples
Example 1: Minimal markup
Create the smallest valid documentation page example that demonstrates contenteditable. Identify which part carries meaning and which parts are only supporting structure. This is Chapter 34, topic 2, example 1.
Example 2: Content variation
Change the text or resource used by contenteditable in the event page. Confirm that the markup still describes the new content correctly instead of depending on the old wording. This is Chapter 34, topic 2, example 2.
Example 3: Missing-information test
Remove one important attribute or related element from the FAQ page example using contenteditable. Explain what meaning, accessibility, navigation, or browser behavior is lost. This is Chapter 34, topic 2, example 3.
Example 4: Accessibility review
Read the photo story example using the semantics of contenteditable. Check names, labels, landmarks, alternatives, focus behavior, and whether the content still makes sense without styling. This is Chapter 34, topic 2, example 4.
Example 5: Mobile review
Open the support page markup containing contenteditable on a narrow screen. Ensure embedded content, long text, controls, and translated labels do not force the page wider than the viewport. This is Chapter 34, topic 2, example 5.
Example 6: RTL review
Translate the dashboard shell into Arabic or Persian. Keep document text RTL where appropriate while URLs, code samples, numbers, and intentionally LTR fragments remain readable. This is Chapter 34, topic 2, example 6.
Example 7: Validation exercise
Run the language page fragment using contenteditable through an HTML validator. Fix invalid nesting, duplicate IDs, missing required attributes, or obsolete markup before adding extra features. This is Chapter 34, topic 2, example 7.
Example 8: Progressive-enhancement check
Use contenteditable in the booking page so the core content remains useful before CSS and JavaScript load. Add enhancement only after the document structure is complete. This is Chapter 34, topic 2, example 8.
Example 9: SEO and semantics review
Inspect how contenteditable contributes to the meaning of the media page. Keep headings, links, metadata, and document regions consistent so crawlers and users receive the same primary content. This is Chapter 34, topic 2, example 9.
Example 10: Production review
Review contenteditable in the school page for validity, accessibility, security-related attributes, performance hints, responsive behavior, localization, and maintainability. This is Chapter 34, topic 2, example 10.
HTML code example
<table>
<caption>Chapter progress</caption>
<thead><tr><th scope="col">Chapter</th><th scope="col">Status</th></tr></thead>
<tbody><tr><th scope="row">Forms</th><td>Complete</td></tr></tbody>
</table>Step-by-step code explanation
- Identify the element or attribute responsible for contenteditable.
- Read the markup from the outer document structure inward and verify that each child is allowed in its parent context.
- Check the semantic meaning and any accessibility relationship such as labels, alternatives, headings, captions, or landmarks.
- Open the fragment in a browser and compare the rendered result with the source instead of assuming visual appearance proves validity.
- Validate the markup and test responsive, RTL, and no-JavaScript behavior where they apply.
Expected browser result: The browser displays or exposes the structure appropriate for contenteditable while preserving the semantic relationships expressed by the markup.
Practice exercise
Write a fresh HTML fragment for contenteditable in Chapter 34. Validate it, remove one important attribute or related element to observe the difference, then restore the correct markup. Test the result with keyboard navigation when interactive, on a narrow screen, and in Arabic or Persian when the content can be translated.
34.3 spellcheck
spellcheck is part of the HTML structure covered in Chapter 34. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
For spellcheck, examine the element's permitted content, relevant attributes, semantic meaning, accessibility effect, and how it behaves when CSS or JavaScript is unavailable. In custom data and editable content, the markup should remain understandable as a document before presentation is added.
In Chapter 34, a reliable way to learn spellcheck is to write a small valid fragment, inspect the browser result and document outline, then test one incorrect or missing attribute. This makes the reason for each piece of markup visible instead of treating HTML as a collection of tags to memorize.
Concept in plain language
spellcheck is part of the HTML structure covered in Chapter 34. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
10 teaching examples
Example 1: Minimal markup
Create the smallest valid FAQ page example that demonstrates spellcheck. Identify which part carries meaning and which parts are only supporting structure. This is Chapter 34, topic 3, example 1.
Example 2: Content variation
Change the text or resource used by spellcheck in the photo story. Confirm that the markup still describes the new content correctly instead of depending on the old wording. This is Chapter 34, topic 3, example 2.
Example 3: Missing-information test
Remove one important attribute or related element from the support page example using spellcheck. Explain what meaning, accessibility, navigation, or browser behavior is lost. This is Chapter 34, topic 3, example 3.
Example 4: Accessibility review
Read the dashboard shell example using the semantics of spellcheck. Check names, labels, landmarks, alternatives, focus behavior, and whether the content still makes sense without styling. This is Chapter 34, topic 3, example 4.
Example 5: Mobile review
Open the language page markup containing spellcheck on a narrow screen. Ensure embedded content, long text, controls, and translated labels do not force the page wider than the viewport. This is Chapter 34, topic 3, example 5.
Example 6: RTL review
Translate the booking page into Arabic or Persian. Keep document text RTL where appropriate while URLs, code samples, numbers, and intentionally LTR fragments remain readable. This is Chapter 34, topic 3, example 6.
Example 7: Validation exercise
Run the media page fragment using spellcheck through an HTML validator. Fix invalid nesting, duplicate IDs, missing required attributes, or obsolete markup before adding extra features. This is Chapter 34, topic 3, example 7.
Example 8: Progressive-enhancement check
Use spellcheck in the school page so the core content remains useful before CSS and JavaScript load. Add enhancement only after the document structure is complete. This is Chapter 34, topic 3, example 8.
Example 9: SEO and semantics review
Inspect how spellcheck contributes to the meaning of the course lesson. Keep headings, links, metadata, and document regions consistent so crawlers and users receive the same primary content. This is Chapter 34, topic 3, example 9.
Example 10: Production review
Review spellcheck in the news article for validity, accessibility, security-related attributes, performance hints, responsive behavior, localization, and maintainability. This is Chapter 34, topic 3, example 10.
HTML code example
<section id="spellcheck">
<h2>spellcheck</h2>
<p>This HTML fragment demonstrates the document structure for spellcheck.</p>
</section>Step-by-step code explanation
- Identify the element or attribute responsible for spellcheck.
- Read the markup from the outer document structure inward and verify that each child is allowed in its parent context.
- Check the semantic meaning and any accessibility relationship such as labels, alternatives, headings, captions, or landmarks.
- Open the fragment in a browser and compare the rendered result with the source instead of assuming visual appearance proves validity.
- Validate the markup and test responsive, RTL, and no-JavaScript behavior where they apply.
Expected browser result: The browser displays or exposes the structure appropriate for spellcheck while preserving the semantic relationships expressed by the markup.
Practice exercise
Write a fresh HTML fragment for spellcheck in Chapter 34. Validate it, remove one important attribute or related element to observe the difference, then restore the correct markup. Test the result with keyboard navigation when interactive, on a narrow screen, and in Arabic or Persian when the content can be translated.
34.4 translate Attribute
translate Attribute is part of the HTML structure covered in Chapter 34. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
For translate Attribute, examine the element's permitted content, relevant attributes, semantic meaning, accessibility effect, and how it behaves when CSS or JavaScript is unavailable. In custom data and editable content, the markup should remain understandable as a document before presentation is added.
In Chapter 34, a reliable way to learn translate Attribute is to write a small valid fragment, inspect the browser result and document outline, then test one incorrect or missing attribute. This makes the reason for each piece of markup visible instead of treating HTML as a collection of tags to memorize.
Concept in plain language
translate Attribute is part of the HTML structure covered in Chapter 34. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
10 teaching examples
Example 1: Minimal markup
Create the smallest valid support page example that demonstrates translate Attribute. Identify which part carries meaning and which parts are only supporting structure. This is Chapter 34, topic 4, example 1.
Example 2: Content variation
Change the text or resource used by translate Attribute in the dashboard shell. Confirm that the markup still describes the new content correctly instead of depending on the old wording. This is Chapter 34, topic 4, example 2.
Example 3: Missing-information test
Remove one important attribute or related element from the language page example using translate Attribute. Explain what meaning, accessibility, navigation, or browser behavior is lost. This is Chapter 34, topic 4, example 3.
Example 4: Accessibility review
Read the booking page example using the semantics of translate Attribute. Check names, labels, landmarks, alternatives, focus behavior, and whether the content still makes sense without styling. This is Chapter 34, topic 4, example 4.
Example 5: Mobile review
Open the media page markup containing translate Attribute on a narrow screen. Ensure embedded content, long text, controls, and translated labels do not force the page wider than the viewport. This is Chapter 34, topic 4, example 5.
Example 6: RTL review
Translate the school page into Arabic or Persian. Keep document text RTL where appropriate while URLs, code samples, numbers, and intentionally LTR fragments remain readable. This is Chapter 34, topic 4, example 6.
Example 7: Validation exercise
Run the course lesson fragment using translate Attribute through an HTML validator. Fix invalid nesting, duplicate IDs, missing required attributes, or obsolete markup before adding extra features. This is Chapter 34, topic 4, example 7.
Example 8: Progressive-enhancement check
Use translate Attribute in the news article so the core content remains useful before CSS and JavaScript load. Add enhancement only after the document structure is complete. This is Chapter 34, topic 4, example 8.
Example 9: SEO and semantics review
Inspect how translate Attribute contributes to the meaning of the contact page. Keep headings, links, metadata, and document regions consistent so crawlers and users receive the same primary content. This is Chapter 34, topic 4, example 9.
Example 10: Production review
Review translate Attribute in the product description for validity, accessibility, security-related attributes, performance hints, responsive behavior, localization, and maintainability. This is Chapter 34, topic 4, example 10.
HTML code example
<section id="translate-attribute">
<h2>translate Attribute</h2>
<p>This HTML fragment demonstrates the document structure for translate Attribute.</p>
</section>Step-by-step code explanation
- Identify the element or attribute responsible for translate Attribute.
- Read the markup from the outer document structure inward and verify that each child is allowed in its parent context.
- Check the semantic meaning and any accessibility relationship such as labels, alternatives, headings, captions, or landmarks.
- Open the fragment in a browser and compare the rendered result with the source instead of assuming visual appearance proves validity.
- Validate the markup and test responsive, RTL, and no-JavaScript behavior where they apply.
Expected browser result: The browser displays or exposes the structure appropriate for translate Attribute while preserving the semantic relationships expressed by the markup.
Practice exercise
Write a fresh HTML fragment for translate Attribute in Chapter 34. Validate it, remove one important attribute or related element to observe the difference, then restore the correct markup. Test the result with keyboard navigation when interactive, on a narrow screen, and in Arabic or Persian when the content can be translated.
34.5 draggable Attribute
draggable Attribute is part of the HTML structure covered in Chapter 34. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
For draggable Attribute, examine the element's permitted content, relevant attributes, semantic meaning, accessibility effect, and how it behaves when CSS or JavaScript is unavailable. In custom data and editable content, the markup should remain understandable as a document before presentation is added.
In Chapter 34, a reliable way to learn draggable Attribute is to write a small valid fragment, inspect the browser result and document outline, then test one incorrect or missing attribute. This makes the reason for each piece of markup visible instead of treating HTML as a collection of tags to memorize.
Concept in plain language
draggable Attribute is part of the HTML structure covered in Chapter 34. HTML communicates meaning and document relationships to browsers, search engines, assistive technology, and other tools, so the choice of element or attribute should match the content rather than only its visual appearance.
10 teaching examples
Example 1: Minimal markup
Create the smallest valid language page example that demonstrates draggable Attribute. Identify which part carries meaning and which parts are only supporting structure. This is Chapter 34, topic 5, example 1.
Example 2: Content variation
Change the text or resource used by draggable Attribute in the booking page. Confirm that the markup still describes the new content correctly instead of depending on the old wording. This is Chapter 34, topic 5, example 2.
Example 3: Missing-information test
Remove one important attribute or related element from the media page example using draggable Attribute. Explain what meaning, accessibility, navigation, or browser behavior is lost. This is Chapter 34, topic 5, example 3.
Example 4: Accessibility review
Read the school page example using the semantics of draggable Attribute. Check names, labels, landmarks, alternatives, focus behavior, and whether the content still makes sense without styling. This is Chapter 34, topic 5, example 4.
Example 5: Mobile review
Open the course lesson markup containing draggable Attribute on a narrow screen. Ensure embedded content, long text, controls, and translated labels do not force the page wider than the viewport. This is Chapter 34, topic 5, example 5.
Example 6: RTL review
Translate the news article into Arabic or Persian. Keep document text RTL where appropriate while URLs, code samples, numbers, and intentionally LTR fragments remain readable. This is Chapter 34, topic 5, example 6.
Example 7: Validation exercise
Run the contact page fragment using draggable Attribute through an HTML validator. Fix invalid nesting, duplicate IDs, missing required attributes, or obsolete markup before adding extra features. This is Chapter 34, topic 5, example 7.
Example 8: Progressive-enhancement check
Use draggable Attribute in the product description so the core content remains useful before CSS and JavaScript load. Add enhancement only after the document structure is complete. This is Chapter 34, topic 5, example 8.
Example 9: SEO and semantics review
Inspect how draggable Attribute contributes to the meaning of the profile page. Keep headings, links, metadata, and document regions consistent so crawlers and users receive the same primary content. This is Chapter 34, topic 5, example 9.
Example 10: Production review
Review draggable Attribute in the documentation page for validity, accessibility, security-related attributes, performance hints, responsive behavior, localization, and maintainability. This is Chapter 34, topic 5, example 10.
HTML code example
<section id="draggable-attribute">
<h2>draggable Attribute</h2>
<p>This HTML fragment demonstrates the document structure for draggable Attribute.</p>
</section>Step-by-step code explanation
- Identify the element or attribute responsible for draggable Attribute.
- Read the markup from the outer document structure inward and verify that each child is allowed in its parent context.
- Check the semantic meaning and any accessibility relationship such as labels, alternatives, headings, captions, or landmarks.
- Open the fragment in a browser and compare the rendered result with the source instead of assuming visual appearance proves validity.
- Validate the markup and test responsive, RTL, and no-JavaScript behavior where they apply.
Expected browser result: The browser displays or exposes the structure appropriate for draggable Attribute while preserving the semantic relationships expressed by the markup.
Practice exercise
Write a fresh HTML fragment for draggable Attribute in Chapter 34. Validate it, remove one important attribute or related element to observe the difference, then restore the correct markup. Test the result with keyboard navigation when interactive, on a narrow screen, and in Arabic or Persian when the content can be translated.
Chapter 34 review — 10 questions and answers
1. What should you check first when using data-* Attributes?
Answer: Check that the markup for data-* Attributes matches the meaning of the content, is valid in its context, and does not depend on visual styling to communicate essential information.
2. How do you review data-* Attributes before publishing?
Answer: Validate the HTML, inspect accessibility and keyboard behavior where relevant, test narrow screens and translated text, and confirm that data-* Attributes adds real document meaning or browser behavior.
3. What should you check first when using contenteditable?
Answer: Check that the markup for contenteditable matches the meaning of the content, is valid in its context, and does not depend on visual styling to communicate essential information.
4. How do you review contenteditable before publishing?
Answer: Validate the HTML, inspect accessibility and keyboard behavior where relevant, test narrow screens and translated text, and confirm that contenteditable adds real document meaning or browser behavior.
5. What should you check first when using spellcheck?
Answer: Check that the markup for spellcheck matches the meaning of the content, is valid in its context, and does not depend on visual styling to communicate essential information.
6. How do you review spellcheck before publishing?
Answer: Validate the HTML, inspect accessibility and keyboard behavior where relevant, test narrow screens and translated text, and confirm that spellcheck adds real document meaning or browser behavior.
7. What should you check first when using translate Attribute?
Answer: Check that the markup for translate Attribute matches the meaning of the content, is valid in its context, and does not depend on visual styling to communicate essential information.
8. How do you review translate Attribute before publishing?
Answer: Validate the HTML, inspect accessibility and keyboard behavior where relevant, test narrow screens and translated text, and confirm that translate Attribute adds real document meaning or browser behavior.
9. What should you check first when using draggable Attribute?
Answer: Check that the markup for draggable Attribute matches the meaning of the content, is valid in its context, and does not depend on visual styling to communicate essential information.
10. How do you review draggable Attribute before publishing?
Answer: Validate the HTML, inspect accessibility and keyboard behavior where relevant, test narrow screens and translated text, and confirm that draggable Attribute adds real document meaning or browser behavior.