Dynamically Load Youtube Video Iframe embed Code inside a DIV

Last updated on
Categories Under // ideasA Template Review by . No Comments

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.

Check the Demo Page for Loading YouTube Video Embed Code Dynamically

How it Works :

The textarea contains the iframe code.  Please note that you can embed any Youtube Iframe embed code and click on the button.  The button is just a link.  It uses “event.preventDefault(); ” function to avoid page refresh.

I have tested it in IE, Firefox.  Please check in your browsers too.  Please comment and enhance the code.

Load YouTube Video Dynamically inside a DIV

Load YouTube Video Dynamically inside a DIV

Incoming search terms:

Latest WordPress Templates

Leave a comment


+ eight = 10

 

Search

Recent Templates

  • Foxy WordPress Theme
  • Infant Prestashop Template 44772
  • Leo Tea Prestashop Theme
  • Gratia - WordPress Simple Creative Theme
  • Sereno | Fully Responsive & Retina Ready WordPress Theme
  • SquidMag - Responsive Multi-Purpose WordPress Theme

WordPress Expert at $11/hour

Hi, I am the webmaster who run this website. I am a WordPress Integrator. If you are need of

-- Adding content to WordPress blog
-- Help in managing plugins and upgrading them.
-- Backing up WordPress Blogs.
-- Modifying theme to suit new ideas and designs.
-- Converting a PSD/JPG/PNG into WordPress

Please contact me at vr@pixelthemes.com or through contact form.

Become Our Fan in Facebook