Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/forms/the-option-element/dynamic-img-alt-change-rendering.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<html class="reftest-wait">
<title>Invalidation test on changing the alt attribute of an img in an <option></title>
<link rel="match" href="dynamic-img-alt-change-rendering-ref.html">
<body>
<select id="dropdown">
<option><img alt="old"></option>
</select>
<select id="listbox" multiple>
<option><img alt="old"></option>
</select>
<script>
document.documentElement.addEventListener('TestRendered', e => {
for (const img of document.querySelectorAll('img'))
img.alt = 'new and longer';
e.target.removeAttribute('class');
});
</script>
</body>
</html>