I have written some jQuery to get a value and then store it in a variable no problem:
$(document).ready(function(){
$('a.news_video_player_list').click(function () {
var youtube = $(this).attr('id');
$('.news_vid_playerL').html('youtube');
});
});
Now that I have the variable "youtube", I'd like to put some HTML inside a div named ".news_vid_playerL" with the variable value. My goal was to do this:
$('a.news_video_player_list').click(function () {
var youtube = $(this).attr('id');
$('.news_vid_playerL').html('<iframe title="YouTube video player" width="610" height="420" src="http://www.youtube.com/embed/+youtube+?&rel=0" frameborder="0" allowfullscreen></iframe>');
});
If you look in the src path, you'll see I put a placeholder +youtube+ which I'd like to populate with the variable value. Not sure how to pull that off.
Thanks!