I'm trying to get a simple javascript function to work. I know enough Javascript to think to myself, "This should work, Why isn't it working!" I'm sure we've all been there before. I have done some research to brush up on my functions and to compare my function to but to no avail, I still can't get this function to work. I'm using Javascript to try to display my name within a span element. Normally this should be easy but, for some reason it just isn't working. This is also done in a .php file and a .html file. Because i wanted to make sure it didn't matter if it was a .php file or .html file. It won't work in either. This is for a php project by the way.
Here's the code

```
<html>
<head>
<script>
var yourName = "Robin";
function placeName()
{
    document.getElementById("myName").innerHTML = yourName;
}   
</script>
</head>
<body>
    <h1>PHP Basics</h1>
    <h2>Hi! My Name is<span id = "myName"></span>
</body>
</html>

```

Like I said, This should be simple, but it won't work. I'm hoping a new set of eyes (you guys) would be able to point out my rookie mistake. If I need to explain anything in more detail please let me know. And thank you all very much.