Jeff Erickson Jeff Erickson - 1 year ago 256
Javascript Question

Open an iframe in a new window with jQuery?

I have a page embedded with an iframe in a Wordpress post, and I want to add a link in the iframe that, when clicked, will open that iframe's html page in a new window. I want to be able to do this without knowing the URL of that iframe. Is this possible? Thank you!

Answer Source

Open window using you can set height, width and other properties of child window. jsfiddle.

   <a href='javascript:void(0)'  onClick=",'_blank','width=800, height=900'); return false;" >Html name </a>


$('a').click(function(){,'_blank','width=800, height=900'); 
  return false;