Home  >  Article  >  Web Front-end  >  How to assign the content of one element to another element in jquery and javascript_jquery

How to assign the content of one element to another element in jquery and javascript_jquery

WBOY
WBOYOriginal
2016-05-16 17:04:351090browse
Copy code The code is as follows:




Copy code The code is as follows:





Untitled Document


<script> <br>$(document).ready(function(){ <br>a=$("#p1")[0].innerText; <br>$("#p2")[0].innerHTML=a; <br><br>}) <br></script>
<script> <br>window.onload=function() { <br>a=document.getElementById("p1").innerText; <br>document.getElementById("p2").innerHTML=a; <br><br>} <br></script>

This is the current title


This is the title




Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn