I'm trying to implement the features from [this site](http://www.html5rocks.com/en/tutorials/webcomponents/customelements/). But my code isn't alerting anything when I click on the x-foo element. Here is my code:

```
<!DOCTYPE html>
<html>
<head>
<title>
    Test
</title>
</head>
<body>
<script type="text/javascript">
    var xFoo = document.createElement('x-foo');
    var xFoo = new XFoo();
    document.body.appendChild(xFoo);
    xFoo.onclick=function(){alert("It works!")};
</script>
<x-foo>
    Test
</x-foo>
</body>
</html>

```

Any suggestions? (I'm on Chrome)