Ask your own question, for FREE!
Computer Science 9 Online
OpenStudy (walters):

how to get the content of a div in another div

OpenStudy (alienium):

yeah i had this problem a few months ago... some js would do the trick when you have <html> <head> <title>lame trick</title> <script> function copy() { var F_Div = document.getElementById('div2'); F_Div.innerHTML=myDiv.innerHTML; } </script> </head> <body> <div id="myDiv"><h1>myDiv Content</div> .... some code here ... <div id="div2"><script>copy();</script></div> </body> </html>

OpenStudy (alienium):

it accesses the div2 with a normal getElementById call then it uses the innerHTML method to assign the contents of myDiv to div2 simply add a call on div2 and it is initialized

OpenStudy (dan815):

hey do you know python

OpenStudy (alienium):

@dan815 i don't, you can ask at the Intro to Python class, they can help you a lot

OpenStudy (dan815):

where is that?

OpenStudy (walters):

|dw:1377309330676:dw| help me with this one i want to make a div that changes when clicking a button

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!