Here is the example:
HTML code:
1 | <div id='parentDiv' class='selectParent' style="height:15px;background-color:yellow;"> |
JQuery Code:
-------------------------------
$('.selectParent').click(function (){
var parentId=$(this).attr("id");
var childId=$(this).find("div").attr("id");
alert("parentDivId :["+parentId+"] childDivId :["+childId+"]");
});
Check live example Here: http://jsfiddle.net/jeetu_verma11/eZLS5/
0 comments:
Post a Comment