<div id="p">
<div id="c">
<img />
</div>
</div>
I am generating the inner div dynamically and also providing the facility to user for add an image inside the inner div. So when user click over the inner div a dialog open , i get the eventobject and then
eventobject = argument.callee.caller.argumets[0];
var innderdivid = $(eventobject.srcElement).parent().attr("id");
through above code i get the inner div id and insert the image in it.
But the problem starts when the div is empty. when it is empty the eventobject.srcElement is innerdiv itself, so in innerdivid , i got “p” instead of “c”. But i want some wayout so when usr click to the empty div then also i get innerdiv id “c” through the above code. tell me how can i do this?
Initialize the image with a 1×1 clear spacer GIF, or an image that has the text “Click me.” In your style sheet, set the height and width to something user-friendly.