On May 20, 4:09 pm, samwyse <samw...@xxxxxx> wrote:
> I've got a script that uses IE for its GUI. When I generate the
> document body, I've got an open-ended set of images with onclick
> properties. When any image is clicked, the script needs to know which
> image was triggered.
>
> Right now, I have this:
>
> for i = 1 to count
> strHTML = strHTML & "<IMG ID=""IMG" & i & """ SRC=""" + image[i]+
> """><BR>"
> next i
> objExplorer.Document.Body.InnerHTML = strBefore & strHTML & strAfter
>
> And a bit later, I have this:
>
> for i = 1 to count
> Set objTemp = objExplorer.document.getElementById("IMG"&i)
> Set objTemp.onclick = GetRef("ClickedOnImage")
> next i
>
> How can my ClickedOnImage routine know which button was clicked?
> Thanks! set oSrc = objExplorer.document.parentWindow.event.srcElement
wsh.echo oSrc.ID, oSrc.Name, oSrc.Value
Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/