changing the barckground image

  • Thread starter Jean Pierre Daviau
  • Start date
J

Jean Pierre Daviau

Hi ,
a simple one,

document.body.background = document.getElementById('item').value

document.getElementById('item').value (an input text) return
the right value for the image.
Why the background is not changed?

Thanks for your attention.

Jean Pierre Daviau
--
Easyphp1.8
Apache1.3.24
DEVC++, borland 5.5
windows Xp
asus p4 s533/333/133
Intel(R) Celeron (R) CPU 2.00 GHz
http://www.jeanpierredaviau.com
 
E

Evertjan.

Jean Pierre Daviau wrote on 02 mrt 2006 in comp.lang.javascript:
Re: changing

NEVER start a new thread with "Re:"
a simple one,

A simple what?
document.body.background = document.getElementById('item').value

This is the code for an Image:

document.body.style.backgroundImage = url("....")
document.getElementById('item').value (an input text)

A background image must be an image (.jpg, .gif, .bmp, etc)
return the right value for the image.

Do not understand.
Why the background is not changed?

That's why.
 
J

Jean Pierre Daviau

Sorry I found it was because the event was in a form submit event.
The page was reloading.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

document.images[0].X 6
circle tracing 10
javascript corrupted? 8
strange TR behavior 2
running an ex on eMac 8
loading order 2
false popup not allowed? 5
document.images 8

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top