1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| <script type="text/javascript">
$(function(){
$("#tree").click(function(){
$("#titremenu").val($(".dynatree-active").children('a:first').html())
})
})
</script>
<style type="text/css">
span {border:solid 1px red;
width:50px; }
</style>
</head>
<body>
<input type="text" id="titremenu"/>
<div id="tree">
<ul class="dynatree-container">
<li class="">
<span class="dynatree-node dynatree-has-children dynatree-exp-c dynatree-ico-c">
<span class="dynatree-expander"></span>
<span class="dynatree-icon"></span>
<a class="dynatree-title" href="#">menu1</a>
</span>
</li>
<li class="dynatree-lastsib">
<span class="dynatree-node dynatree-lastsib dynatree-exp-cl dynatree-ico-c dynatree-active">
<span class="dynatree-connector"></span>
<span class="dynatree-icon"></span>
<a class="dynatree-title" href="#">menu2</a>
</span>
</li>
</ul>
</div> |