Tips: Dynamically Load Youtube Video Iframe embed Code inside a DIV

Discussion in 'JavaScript' started by nirmala.prc, Jan 14, 2013.

  1. #1
    Hi,

    Just wanted to share a Javascript snippet here.

    By storing or by having the Iframe embed code as a variable, You can play the Youtube video on a click of a button or any other event. I have used “append” function of jQuery to append the IFrame code dynamically inside a DIV tag.

    Source URL

    Demo URL

    Best Regards,

    Nirmala
     
    nirmala.prc, Jan 14, 2013 IP