changing the barckground image

Discussion in 'Javascript' started by Jean Pierre Daviau, Mar 2, 2006.

  1. 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
    Jean Pierre Daviau, Mar 2, 2006
    #1
    1. Advertising

  2. Jean Pierre Daviau

    Evertjan. Guest

    Jean Pierre Daviau wrote on 02 mrt 2006 in comp.lang.javascript:
    > Hi ,


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


    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., Mar 2, 2006
    #2
    1. Advertising

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


    "Jean Pierre Daviau" <> a écrit dans le message de news:
    NvCNf.32$W%...
    > 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
    >
    Jean Pierre Daviau, Mar 2, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Samridhi Kumar Shukla
    Replies:
    1
    Views:
    515
    Alvin Bruney
    Nov 30, 2003
  2. Replies:
    2
    Views:
    459
  3. Laszlo Zsolt Nagy
    Replies:
    1
    Views:
    1,248
    Kartic
    Jan 26, 2005
  4. Aaron Beall
    Replies:
    2
    Views:
    1,773
    Aaron Beall
    Sep 14, 2007
  5. VK
    Replies:
    3
    Views:
    162
    Dr J R Stockton
    Mar 15, 2007
Loading...

Share This Page