get selected image object in iframe

I want to acess a selected image object which is in iframe.
i am using this code alert(window.parent.frames[0].window.document.selection.type)
it displays control.But i want the selected image object.Iam trying below code.but iam unable to get the object.how can i get the selected image object
alert(window.parent.frames[0].window.document.selection.controlRange.item())
sastry_sagiAsked:
Who is Participating?
 
sastry_sagiAuthor Commented:
the main problem is i am having 3 to 4 images in the iframe with same ID. i changed the code to give the ID's dynamically. i will test the above solution with my new code and i will update you.,
0
 
Michel PlungjanIT ExpertCommented:
How about just making the image clickable?

0
 
sastry_sagiAuthor Commented:
Hi expert,
      Iam also using onclick event for image in onclick event iam showing one div with some options if i click on one option a modalopopup is open.In this is scenario I want to access the select image object in that modal pop-up. if I alert this "window.parent.frames[0].window.document.selection.type"  message iam getting control. But I want to access  object.How can I get access to the image object??
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
Michel PlungjanIT ExpertCommented:
sounds a bit much.


Perhaps

window.parent.frames[0].window.document.selection.createRange().parentElement().document.getElementsByTagName('img')[0]


0
 
sastry_sagiAuthor Commented:
the solution is not working for me.
0
 
Michel PlungjanIT ExpertCommented:
then I have no more suggestions
0
 
santosh_cdacCommented:
Even i want solution for this question.
Any help appreciated.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.