xdevel2000
xdevel2000

Reputation: 21364

CSS problem with visibilty

I have the following code:

var d = document.createElement("div");
d.id = "d_1";
d.style.backgroundImage = "url(img/lr.png");
d.style.backgroundRepeat = "no-repeat";
d.style.width = "150px";
d.style.height = "25px";
d.style.position = "absolute";
d.style.left = "460px";
d.style.top = "385px";
d.style.visibility = "visible";
document.documentElement.appendChild(d);

and that div isn't show with Opera and Chrome but it's show with firefox!

What's wrong?

Upvotes: 0

Views: 73

Answers (2)

Silver Light
Silver Light

Reputation: 45922

Correct this line:

d.style.backgroundImage = "url(img/lr.png");

to

d.style.backgroundImage = "url(img/lr.png)";

Upvotes: 1

nnevala
nnevala

Reputation: 5997

Syntax error.

d.style.backgroundImage = "url(img/lr.png");

Should be

d.style.backgroundImage = "url(img/lr.png)";

Upvotes: 4

Related Questions