The example in this article describes the method of changing Src in Iframe using js. Share it with everyone for your reference. The specific implementation method is as follows:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title></title> <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1"> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> <script type="text/javascript"> function test(Url) { document.frames[0].location.href =Url; } </script> </head> <body> <iframe id="xx" src=""></iframe> <a onclick="test('top.html')" href="#">linkbutton</a> </body> </html>
I hope this article will be helpful to everyone’s JavaScript programming design.