dynamic-attr-01.html (789B)
1 <!DOCTYPE HTML> 2 <html class="reftest-wait"> 3 <head> 4 <title>CSS 2.1 Test Suite: generated content</title> 5 <link rel="author" title="Robert O'Callahan" href="mailto:robert@ocallahan.org" /> 6 <link rel="author" title="Mozilla Corporation" href="http://mozilla.com/" /> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#content"/> 8 <meta name="flags" content="dom" /> 9 <style> 10 body { 11 font-family:sans-serif; 12 } 13 body::before { 14 content:attr(my-attr); 15 } 16 body::after { 17 content:attr(my-attr-2); 18 } 19 </style> 20 <script> 21 function fixupDOM() { 22 document.body.setAttribute("my-attr", "before"); 23 document.body.setAttribute("my-attr-2", "after!"); 24 document.documentElement.className = ""; 25 } 26 </script> 27 </head> 28 <body my-attr-2="xyz" onload="fixupDOM()"> 29 </body> 30 </html>