Home > Web Front-end > JS Tutorial > 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
Release: 2016-05-16 17:04:35
Original
1107 people have browsed it
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




Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template