Changing background image to a button

Posted by Alpan67 on Stack Overflow See other posts from Stack Overflow or by Alpan67
Published on 2010-05-29T07:38:29Z Indexed on 2010/05/29 7:42 UTC
Read the original article Hit count: 237

Filed under:
|
|

I am trying to change the backgound-image of a button but it doesn't work as I thought !! the CSS is OK and it is as follows :

ITA{

float:right; margin : 5px 85px; width:40px; height:40px; background : #FFFFFF url("../ITA_off.png") center center no-repeat; border:0; }

my javascript function in the "HEAD" is

function cambiaBandiera() { test=document.getElementById("ITA"); test.backgroundimage="ITA_on.png"; }

and the button is as follows

input type="button" id="ITA" onClick="cambiaBandiera()"

What's wrong ?

Please HELP !

Thanx in advance

Alex

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html