We help IT Professionals succeed at work.
Get Started

What am I missing?

Arthalius
Arthalius asked
on
177 Views
Last Modified: 2013-11-05
OK, I'm trying to do something here that should be fairly simple. I have an A located in my code that needs to have a different HREF value based upon the browser and some other data the user enters. The problem is that I cant get this to work. Here is an example of a greatly simplified version of the code that is producing the problem :

<a id="fms" class="player" style="display:block;width:624px;height:352px" href="#">
     <img src="/flowplayer/intro.png" alt="Click here to start playback" width="624px" height="352px" border="0" />
</a>

<script type="text/javascript" >
     document.getElementByID("fms").href = "http://www.google.com";
</script> 

Open in new window


In FF, the code simply doesn't work. In IE8, the code fails with the error message, "Object doesn't support this property or method". I've looked up the docs and it looks to me like this SHOULD be working. Any ideas?
Comment
Watch Question
Multitechnician
CERTIFIED EXPERT
Distinguished Expert 2020
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE