tags:

views:

191

answers:

6

I call the following function with a mouseover event but it's not working. My id's are all correct & I have properly linked all my external scripts.

function new2() {
var prevWin = document.GetElementById("recentlyaddedtip");
prevWin.style.visibility = "visible";
}

recentlyaddedtip is set as hidden in the stylesheet (and it properly changes to visible when I change it manually.)

+9  A: 

JavaScript is case sensitive.

Try:

document.getElementById('recentlyaddedtip');

Notice the small 'g'.

SolutionYogi
The code as normal text was driving me crazy. Fixed. +1 for the being the fastest gun. :)
Paolo Bergantino
Not a problem. And there are folks who provide answers while I am still typing! :)
SolutionYogi
A: 
var prevWin = document.getElementById("recentlyaddedtip");
Darin Dimitrov
A: 

getElementById is a case sensitive function name.

mgroves
A: 

You shouldn't uppercase the G in GetElementById, it should be getElementById(). JavaScript is case sensitive ;-)

Byron Whitlock
A: 

GetElementById should be getElementById (note the case)

John Montgomery
A: 

Well, I don't see your mouseover function so I don't know if that's spelled right, but try:

var prevWin = document.getElementById("recentlyaddedtip");

with a lowercase g.

Chet