How to Change IFrame Source using JQuery


In order to change the source of an iframe with jQuery you have to change the src attribute of the HTML element as shown below:

<iframe id="myFrame" src="http://www.example.com/"></iframe> 

<script type="text/javascript"> 

   $("#myFrame").attr('src', 'http://www.ezzylearning.com'); 

</script>

 

 

About author


User avatar

Waqas Anwar

Founder of EzzyLearning.com, Senior Consultant, Microsoft .NET and Web Technologies

Comments