I have on object and I want to print their name and property name. How can I do that. I can access their properties value. Like I want print object name like 'first' and 'second' and their properties like 'value' and 'text' dont want to print value
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="jquery-1.7.2.js"></script>
<script type="text/javascript">
$(function (){
var myDate= {
'first':{value:'30',text:'i am the one'},
'second':{value:'50',text:'i am the second'}
}
$('a').click(function (){
var t= $(this).text();
if(t=="both"){
$('.text').text(myDate['first'] + '' + myDate['second'] );
} else {
$('.text').text(myDate[t]);
}
});
});
</script>
</head>
<body>
<div class="text"></div>
<a href="#">first</a> <a href="#">second</a>
<a href="#">both</a>
</body>