Change iframe url using javascript

If you want to change the iframe url from the iframe window, you can use this small function to change the url of the iframe.

<script type=”text/javascript”>
$(document).ready(function() {
function() {
return false;

Explanation of the above script

  • clickToClose is the ID of the html tag by which you want to change the url after clicking on this.
  • window.parent is used to get the frame of the parent window to change the url.
  • frames[“myframe”] is the name of the iframe.

To seek challenging roles and to achieve excellence in the field of Open Source Web Technology with a profound spirit of commitment and dedication.

Share This Post

Related Articles

© 2017 Sumit Bansal. All rights reserved. Site Admin · Entries RSS · Comments RSS
Powered by WordPress · Designed by Theme Junkie