日期:2014-05-16  浏览次数:20390 次

求大神赐教,如何点击某段文字,会在左侧的文本域中出现相应的文字?
我点击右侧的文字,在左侧会出现相应的文字,






我想要的这个效果可以看看这个网页:http://xm.875.cn/sahzt/index.html?aid=443&sid=3047
?JavaScript?div+css?

------解决方案--------------------

<style type="text/css">
#div1{
height:50px;
width:300px;
margin-left:300px;
margin-top:-150px;
padding:15px;
background-color:#8FBC8F;
border:1px solid black
}
</style>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(function(){
$("#div1").click(function(){
$("textarea").val($("#div1").text());
});
})
 </script> 
<textarea rows="10" cols="30"></textarea>   
<div id="div1">
 此项目很好 此项目很好
  此项目很好 此项目很好
   此项目很好 此项目很好
    此项目很好 此项目很好
</div>