How do I dynamically change the content in an iframe using jquery?

后端 未结 3 1822
夕颜
夕颜 2020-11-30 21:47

I was wondering if it is possible to have a site with an iframe and some jquery code that changes the iframe content every 30 seconds. The content is in different webpages.<

3条回答
  •  盖世英雄少女心
    2020-11-30 22:12

    If you just want to change where the iframe points to and not the actual content inside the iframe, you would just need to change the src attribute.

     $("#myiframe").attr("src", "newwebpage.html");
    

提交回复
热议问题