When I click the button the fancybox iframe open and the video is playing but the button I clicked just disappears.
HTML
<div id="playlightbox">
<a id="videoplay" class="fancybox fancybox.iframe" rel="group"></a>
</div>
Javascript
$(document).ready(function() {
$(".fancybox").fancybox();
});
button.onclick = function () {
var selectedId = this.id;
onYouTubeIframeAPIReady(selectedId);
var videoUrl = 'http://www.youtube.com/embed/' + player.h.h.videoId;
var a = document.getElementById('videoplay');
a.setAttribute('href', videoUrl);
a.appendChild(this); //reason the button disappear
};
Devoloper Tools (when I click the button this is what I get in devloper tools, and it works but the button disappears)
<a id="videoplay" class="fancybox fancybox.iframe" rel="group" href="http://www.youtube.com/embed/JP5Dr63TbSU"><button id="JP5Dr63TbSU" style="height: 35px;">Watch Trailer</button></a>
Any help is very much appreciated! =]