javascript - Take element ( ID ) and show it anywhere on page -
this tricky question , have little knowledge of js, well, trying pick element page , show on anywhere calling it.
actually, element coming different source in header, , want show in content area. used margin-top -1000px value on different page render on different height of page. in heading overlapping text because can"t make exact on every page.
so, looking solution pick element , call in specific area of webpage , hide css
<div id="places"> <img src="foo.png"/></div>
so, there way pick places webpage , call anywhere in webpage again.
thank :)
yes, create var stores value , add value other div.
the div content:
<div id="places"> <img src="foo.png"/></div>
the div want display content other div:
<div id="my_div"></div>
js:
$( document ).ready(function() { var places = $('#places').html(); //grab html first div $('#my_div').append(places); //add html second div });
Comments
Post a Comment