First Case:
<div>
<a href="#" onclick="doIt(this)">some job</a>
<div>
i can do:
<script>
function doIt(caller){
alert($(caller).closest('div').html());
}
</script>
Second Case:
<div id="divId">
....
</div>
i do
<script>
alert($("#divId").html());
</script>
how can i apply first case mecanism to second case with out onclick(this)?
more details about question:
First case, as i use of anchor onclick, i can get action source then it's parent.
Second case, on the other hand, there is div block and after script block. they are rendered in the page, consequence there is no click event. i need some thing:
$(this).closest('div').html()but it doesnt work