1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

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

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

  1. #1

    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.prc, Jan 14, 2013 IP