javascript - Replace Text in a Div with text in another Div -


<div id="replaceme">i'm girl</div>  <div id="iamreplacement" style="display:none">no boy girl</div> 

the text in replaceme should replaced text in iamreplacement

i think can done in java script or jquery.. can 1 me on this..

tried (not working)

<script>     jquery('#replaceme').replacewith(jquery('#iamreplacement')); </script> 

try jquery:

$("#replaceme").html($("#iamreplacement").html()); 

or pure javascript:

document.getelementbyid("replaceme").innerhtml = document.getelementbyid("iamreplacement").innerhtml; 

Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -