js 内容传递

来源:百度知道 编辑:UC知道 时间:2024/05/17 04:48:07
<div id="1">我要把这里变成加粗的带有链接的123456</div>

<div id="2" onclick="document.getElementById("1").innerHTML='<strong><a href="#">123456</a></strong>';">
点这里看看,怎样才能把所123456传递到div1里?
<div>

单击DIV2的时候,需要把<strong><a href="#">123456</a></strong>传到DIV1里
请问如何实现?
谢谢回答
不过我从数据库调用内容又遇到问题
<% for i=1 to rs.pagesize>
<div id="2" onclick="document.getElementById("1").innerHTML='<%=rs("p1")%>';">
<%rs.movenext...%>

这种情况如何简便处理,谢谢了

<script>
function fun2()
{
document.getElementById("a1").innerHTML='<strong><a href="#">123456</a></strong>';
}
</script>
<div id="a1">我要把这里变成加粗的带有链接的123456</div>
<div id="a2" onclick="fun2()">
点这里看看,怎样才能把所123456传递到div1里?
</div>