<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>createElement ().localName</title>
</head>
<body>
<p id="result">FAIL (not executed)</p>
<script type="text/javascript">
  var result = document.getElementById ('result');
  result.firstChild.data = 'FAIL';
  var el = document.createElement ('prefix:elementName');
  if (typeof (el.localName) == 'undefined') {
    result.firstChild.data = 'FAIL (undefined)';
  } else if (el.localName == null) {
    result.firstChild.data = 'PASS (as per DOM3)';
  } else if (el.localName == 'prefix:elementname') {
    result.firstChild.data = 'FAIL (lowercase)';
  } else if (el.localName == 'prefix:elementName') {
    result.firstChild.data = 'FAIL (as is)';
  } else if (el.localName == 'PREFIX:ELEMENTNAME') {
    result.firstChild.data = 'FAIL (uppercase)';
  } else {
    result.firstChild.data = 'FAIL';
  }
</script>
</body>
</html>