<html xmlns="http://www.w3.org/1999/xhtml" xml:id="test">
 <style>
  html{ background:red }
 </style>
 <script>
  window.addEventListener("load",foo,false);
  function foo(e){
   document.getElementById('test').style.background = "lime";
  }
 </script>
 <p>This page should have a green background.</p>
</html>