일부 세부 정보가 포함 된 객체가 있으며 HTML에는 세 가지 하이퍼 링크가 있습니다 (첫째, 둘째 및 둘 다). 나는 하이퍼 링크를 클릭 할 때 객체의 텍스트를 일치시키고 div에 추가 할 수 있기를 원합니다.Jquery에서 클릭시 객체의 텍스트에 액세스하는 방법
<head>
<style>
.text { border:solid 1px #F00; height:30px;}
</style>
<script type="text/javascript" src="jquery-1.7.2.js"></script>
<script type="text/javascript">
var myDate= {
'first':'hi i am first object',
'second':'hi i am second object'
}
$(function(){
$('.text').text()
})
</script>
</head>
<body>
<div class="text"></div>
<a href="#">first</a> <a href="#">second</a>
<a href="#">both</a>
</body>
힌트 : ['.click()를'] (http://api.jquery.com/click/) – Alexander