Link to home
Start Free TrialLog in
Avatar of samprg
samprg

asked on

Update element

Hello,
I have tow Javascript function in html to add website, I need those fonctions use same iframe.

<script language="javascript" type="text/javascript">
// <!CDATA[

function Button1_onclick() {
      var iframe = document.createElement('iframe');
      iframe.src = "http://www.bing.com";
      iframe.style.width = '100%';
      iframe.style.height = "60px";
      iframe.name = "internal";
      iframe.scrolling = "yes";
      iframe.marginwidth="0";
      iframe.frameborder="0";
      iframe.marginheight="0";
      iframe.vspace="0";
      iframe.hspace="0";
      
      document.body.appendChild(iframe);
}
function Button2_onclick() {

      var iframe = document.createElement('iframe');
      iframe.src = "http://www.yahoo.com";
      iframe.style.width = '100%';
      iframe.style.height = "60px";
      iframe.name = "internal";
      iframe.scrolling = "yes";
      iframe.marginwidth="0";
      iframe.frameborder="0";
      iframe.marginheight="0";
      iframe.vspace="0";
      iframe.hspace="0";
      
      document.body.appendChild(iframe);
}


// ]]>
</script>
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of samprg
samprg

ASKER

Awesome