# Simulate image click from different frame

**URL:** <https://forum.kirupa.com/t/simulate-image-click-from-different-frame/273800>\
**Category:** web dev\
**Created:** [October 21, 2008, 3:11am UTC](https://forum.kirupa.com/t/simulate-image-click-from-different-frame/273800 "2008-10-21T03:11:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Multi\_Task](https://avatars.discourse-cdn.com/v4/letter/m/c6cbf5/32.png) [@Multi\_Task](https://forum.kirupa.com/u/Multi_Task)\
**Post date:** [October 21, 2008, 3:11am UTC](https://forum.kirupa.com/t/simulate-image-click-from-different-frame/273800/1 "2008-10-21T03:11:54Z")

</div>

I have a button in a frame with id=“leftFrame”

In another frame with id=“mainFrame” on the same page and same domain I have a div that holds and image that activates that div for movement.

How can I simulate that click from the something in the left frame?  
I have tried for button in leftFrame:

```auto

<div id="admin">
    <img src="images/slideIt.gif" onclick="clickers()"/>
  </div>

function clickers() {
        parent.frames['mainFrame'].document.getElementById('slider').click();
        also tried
        parent.frames[1].document.getElementById('slider').click();
    }

```

In mainFrame I have:

```auto

<a href="#" id="slider"><img src="images/slideleft.gif" alt="slider" title="slider" /></a>

```

Thanks in advance I can seem to simulate even an alert call in the other frame. Am I accessing it wrong via DOM practices?
