I have below html:
<div class="threeimages" id="txtCss">
<a>
<img alt="Australia" src="/Images/Services%20button_tcm7-9688.gif"/>
</a>
<div class="text" id="txtLink">
<h2>
<a href="/partnerzone/downloadarea/school-information/australia/index.aspx">Australia</a>
</h2>
<p>Land of the sunshine!</p>
</div>
</div>
Now if you see there is href in div ID "txtLink" i.e. Australia
I want this at the runtime of page the same href values get copied into above tag of div ID "txtCss", I mean when my page gets displayed my html will be as below:
<div class="threeimages" id="txtCss">
<a href="/partnerzone/downloadarea/school-information/australia/index.aspx">
<img alt="Australia" src="/Images/Services%20button_tcm7-9688.gif"/>
</a>
<div class="text" id="txtLink">
<h2>
<a href="/partnerzone/downloadarea/school-information/australia/index.aspx">Australia</a>
</h2>
<p>Land of the sunshine!</p>
</div>
</div>
please suggest some code for above problem
Update
An answer without jquery here: https://stackoverflow.com/a/887348/11333
Back in 2009 it was perfectly acceptable to use jquery though :)
Create a js file with something like this:
Reference both the jquery and this javascript file in your html. Something like this:
You can use:
I think that this should work..
this is the shortest answer without using any library and works only thing what you want
This is a simple understandable code: