Login | |
|
 |
RE: VBScript equivelent of GetElementsByName("name... - 5/24/2007 8:05:50 AM
|
|
 |
|
| |
bortiquai
Posts: 6
Score: 0
Joined: 5/24/2007
Status: offline
|
Hmm... Maybe it's my syntax then... Here is an example of my code for what I am trying to do: <head> <title>My Page Title</title> <script type="text/vbscript"> sub ChangePic() strElm = Document.GetElementsByName("Image1") msgBox(strElm[0].src) end sub </script> </head> <html> <a onclick=ChangePic() href="vbscript:;"><img src="Coqui3.jpg" width="250" height="167" name="image1"></a> </html> So as you can see, when you click on the image, it should pop a Message Box that has the source ("Coqui3.jpg"). However, when i do this, i get a "Error on page" in my browser, and when i click to view the error, it says "Line 1, Char 1, Syntax Error, Code 0, Url: ThenTheFileName.html" If I take out the part that says "Document.GetElementsByaName("image1") and replace it with a "String in quotes", then have it say msgBox(strElm), it runs fine. What am i doing wrong? thanks MATT
|
|
| |
|
|
|
|
|