Create iframe dynamically using jQuery
Hello Friends,
Creating iframe using jQuery is not a difficult task. If you want to create iframe dynamically using jQuery, than look at below code.
Below is the code for generating dynamic iframe with jQuery.
$('<iframe />'); // Create an iframe element
$('<iframe />', {
name: 'frame1',
id: 'frame1',
src: 'http://www.programmingfacts.com'
}).appendTo('div#id');
// For older version of jQuery
$('<iframe />').attr('src', 'http://www.programmingfacts.com'); // Add iframe attributes
You can add iframe attribute as second parameter as per jQuery 1.4. For older version of jQuery, you can refer the syntax mention as above. If you find any problem in this than let me know by comment.






I am
about 1 year ago
Oh no, iframes are ill
greetings
about 1 year ago
Oh no, iframes are ill
greetings
about 1 year ago
You have done a marvelous job by exploring this subject with such an honesty and depth. Thanks for sharing it with us!
about 1 year ago
You have done a marvelous job by exploring this subject with such an honesty and depth. Thanks for sharing it with us!