javascript - How to merge two different HTML? -


how can merge 1 table table other page?

i basicly having 3 radio buttons.

my intention when first tick a,then show website , next while ticking b...i shall able view website too...so after thinking b...i see website on left & website b on right.

but code below not work expected...it juz display content of last radio button tick.

kindly assist.tq

<!doc html> <html> <title></title> <head> <script type="text/javascript">  <!-- function show(id) {  if (document.getelementbyid(id).style.display == 'none')  {       document.getelementbyid(id).style.display = '';  } } //-->  <!-- function hide(id) {       document.getelementbyid(id).style.display = 'none';  } //--> </script>  </head> <body> <table cellspacing="1" cols="3" border="0"> <tbody> <tr valign="top" align="left">   <td width="202"><b>please, select option</b></td>    <td width="481">a     <input type="radio" name="option" onfocus="hide('tblb');hide('tblc');show('tbla');">     b     <input type="radio" name="option"            onfocus="hide('tbla');hide('tblc');show('tblb');return true;">     c           <input type="radio" name="option"   onfocus="hide('tbla');hide('tblb');show('tblc');return true;">   </td>  </tr>  </tbody> </table>   <table id="tbla" style="display: none" cols="1" cellpadding="2"> <tbody> <tr valign="top" align="left">  <td>   you&nbsp;select a,   table   tbla shown<frameset cols="50%,*"> <frame src="http://www.huawei.com"> </frameset>&nbsp;   </td> </tr> </tbody> </table> <table id="tblb" style="display: none" cols="1" cellpadding="2"> <tbody> <tr valign="top" align="left">   <td>    you&nbsp;select b, table tblb    shown<frameset cols="50%,*"><frame src="https://www.google.com/"></frameset>&nbsp;   </td> </tr> </tbody> </table> <table id="tblc" style="display: none" cols="1" cellpadding="2"> <tbody> <tr valign="top" align="left">   <td>    you&nbsp;select c, table tblc    shown&nbsp;   </td> </tr> </tbody> </table>     </body> </html> 

http://jsfiddle.net/a5kqa/

i'm not sure understand question, might help.

http://jsfiddle.net/isherwood/exeje

<b>please select option</b> <input type="radio" name="option" /> b <input type="radio" name="option" /> c <input type="radio" name="option" />  $('input[type="radio"]').click(function () {     $('table').eq( $(this).index() -1 ).show(); }); 

here's better approach doesn't use tables layout:

http://jsfiddle.net/isherwood/exeje/5

.frame-wrapper {     display: none;     float: left;     width: 32%;     margin-right: 1%; }  <div id="tbla" class="frame-wrapper">     selected a, table tbla shown      <frame src="http://www.huawei.com" /> </div>  $('input[type="radio"]').click(function () {     $('.frame-wrapper').eq( $(this).index() -1 ).show(); }); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -