Personally recommend using jQuery to implement it, the code is simple and scalable.
jQuery part:
function gotourl(url_a, url_b)
{
$('#ifr_a').get(0).src = url_a;
$('#ifr_b').get (0).src = url_b;
}
html call:
Click me and the content of the two iframes below will change It is also possible to determine the id of the iframe through js, and then assign different src values to different ids, but the code is relatively complicated.
Original text published on Mr.Think’s personal blog:
http://mrthink.net/javascript-jquery-twourl-twoifram/