javascript - using a tag to replace div -


my site has 2 pages both have hyperlinks each other when user click on hyperlink need div of page replaced div on other page, please guide me how program it.

structure

page1.html

<div id="no_replace">   <a href="page2.html">page 2</a>   <div id="replace">     //page 1 stuff   </div> </div> 

page2.html

<div id="no_replace">   <a href="page1.html">page 1</a>   <div id="replace">     //page 2 stuff   </div> </div> 

so on page 1 when usr clicks on link "page two" ... want 'replace' div of page 1 replaced 'replace' div of page2.html

you need use javascript trigger event content of div replace when button clicks. learn javascript w3schools.

<script type="text/javascript"> function dosomething(){  //replace div content here } </script> <a href="somelink" onclick="dosomething();"> 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -