Posted in Javascript onJanuary 09, 2014
<span style="font-size:24px;"> </span>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> </head> <script src="jquery-1.9.0.min.js"></script> <script> $(document).ready(function(){ a=$("#p1")[0].innerText; $("#p2")[0].innerHTML=a; }) </script> <script> window.onload=function(){ a=document.getElementById("p1").innerText; document.getElementById("p2").innerHTML=a; } </script> <body> <p id="p1" name="这是现在的标题">这是现在的标题</p> <p id="p2" name="这是标题">这是标题</p> </body> </html>
jquery和javascript中如何将一元素的内容赋给另一元素
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@