user117399
user117399

Reputation:

getElementById problem

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.)

Upvotes: 0

Views: 598

Answers (6)

SolutionYogi
SolutionYogi

Reputation: 32243

JavaScript is case sensitive.

Try:

document.getElementById('recentlyaddedtip');

Notice the small 'g'.

Upvotes: 11

Chet
Chet

Reputation: 22105

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.

Upvotes: 0

John Montgomery
John Montgomery

Reputation: 9058

GetElementById should be getElementById (note the case)

Upvotes: 0

Byron Whitlock
Byron Whitlock

Reputation: 53921

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

Upvotes: 2

Matthew Groves
Matthew Groves

Reputation: 26169

getElementById is a case sensitive function name.

Upvotes: 0

Darin Dimitrov
Darin Dimitrov

Reputation: 1039408

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

Upvotes: 0

Related Questions