Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

click on image to do something

Status
Not open for further replies.

mattbold

Programmer
Oct 5, 2001
45
GB
hi
ive written some vbscript that does things when you click on a button on a web page, how do i do it so that when you click on an image or some text the same action is carried out?

cheers,
matt
 
With an Image, just give the <IMG> tag an ID attribute: <img ID=&quot;MyId&quot; src=&quot;.....&quot;>

Then in VBScript just reference the ID:

<script language=vbscript>
sub MyID_OnClick()
MYID.Style.display=&quot;None&quot; 'This is just an example
End Sub
</script>

With Text, you want to use a <SPAN> Tag and give it an ID attribute. Reference the same way as above.

Hope this helps! Tazzmann
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top