Evaluating Experimental HTML Features Safely
Define the fallback before the enhancement
A feature can appear in a standard before it reaches all target browsers. Start with a labelled native select and plain options. A new styling capability must not be required to choose or submit a value. The CSS supports rule applies a cosmetic enhancement only when the browser recognizes the declaration.
<style> @supports (appearance: base-select) { select, ::picker(select) { appearance: base-select; } }</style><label for="topic">Topic</label><select id="topic" name="topic"> <option value="html">HTML</option> <option value="css">CSS</option></select>The control has a usable value even without custom styling.
Detect the exact capability
Feature detection tests the capability being used, instead of guessing from a browser name or user-agent string. CSS.supports checks whether a declaration is recognized; a separate behavioral test is needed to establish correct picker rendering and keyboard operation. This result deliberately reports the detected condition rather than hard-coding a browser list.
<output id="result"></output><script> const supported = CSS.supports("appearance", "base-select"); document.querySelector("#result").textContent = supported ? "Declaration recognized" : "Keep native appearance";</script>The output reflects the current browser, not a universal support claim.
Test real behavior independently of detection
For customizable select, selectedcontent can mirror the selected option in supporting browsers. The plain option text is the fallback. Verify value changes, accessible naming and form data separately; the presence of an element or interface alone does not prove behavior. This small probe checks whether selection updates the displayed copy.
<form id="settings"> <label for="theme">Theme</label> <select id="theme" name="theme"> <button> <selectedcontent></selectedcontent> </button> <option value="light">Light</option> <option value="dark">Dark</option> </select></form><output id="result"></output><script> const select = document.querySelector("#theme"); select.value = "dark"; const display = select.querySelector("selectedcontent"); document.querySelector("#result").textContent = display?.textContent.trim() === "Dark" ? "Copy updated" : "Native fallback";</script>The submitted value is dark; the output reports the observed copy behavior.
Common mistakes and practice
Record the exact subfeature, target browser versions, fallback, tests and rollback plan. An experimental label is not a complete compatibility matrix. Test real input, focus, assistive technology and submission separately. Never require an unverified feature for a core operation.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Evaluating Experimental HTML Features Safely — Knowledge Check
Apply the legacy migration and compatibility concepts taught in this lesson.
What does CSS.supports establish?
What must work without new select styling?
Why inspect selectedcontent separately?
What is a good adoption plan?
What should be tested beyond visual styling?