Play Youtube videos On a Embedded Player Upon clicking Multiple hyperlinks

Hi guys… I am just starting to learn JavaScript. I wanted to know how to have multiple hyperlinks (Containing links to Youtube Videos) that when clicked, cause the corresponding videos to play on the Youtube Player Embedded on the site. I hope my question is not too confusing. Thank you in advance!

P.S.
I saw some Source Code relating to this on StackOverflow and copied it and couldn’t get it to work… Here’s my source code.

<html>
<head>
<title> Sample Page </title>
<script>
// Get element holding the video (embed or object)
var player = document.getElementById("MOVIE");

//Create a simple function and check if player exists
function play() {
    if(player) {
        player.playVideo();
    }
}
</script>
</head>
<body>
<object width="420" height="315"><param name="MOVIE" value="http://www.youtube.com/v/HsQIoPyfQzM?version=3&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/HsQIoPyfQzM?version=3&amp;hl=en_US" type="application/x-shockwave-flash" width="420" height="315" allowscriptaccess="always" allowfullscreen="true"></embed></object>
</br></br>
<a href="http://youtu.be/sPvqNMb4StI" onclick="play()"> THIS IS FIRST Video Link </a></br></br>
<a href="http://youtu.be/w7_Ccu21QVs" onclick="play()"> THIS IS SECOND Video Link </a>
</body>
</html>

Any Kind souls out there to help me? =) Or is my question unclear?

something like this? http://sospets.brinkster.net/htmlpage2.htm
if yes then just copy the source code thats all u need.

That was exactly what I was looking for! Thank you so much Sir! :slight_smile: