How to create an iframe using jQuery, and display on page?

       $('.accordion').load('<iframe src="" frameborder="0" scrolling="no" id="myFrame"></iframe>');

This can’t display the iframe of Can anyone provide suggestions on how to fix it?


jQuery’s load function isn’t used this way. It takes a URL as a parameter, among others, and loads the response from that URL.

If you are trying to create an iframe DOM element, use the jQuery function to do this and append it where you want:

$('<iframe src="" frameborder="0" scrolling="no" id="myFrame"></iframe>')


$('<iframe>', {
   src: '',
   id:  'myFrame',
   frameborder: 0,
   scrolling: 'no'