I have a div I'm displaying a button image on. I'm displaying a sprite actually. I'd added an onlick attribute to the tag and it calls a function called ACFunction. I know how to set the style attribute with css properties using javascript but I need to set the style attribute with each one of these properties below except I will set them to have different values slightly and those values will allow for the image I want to be displayed when the button is clicked, to show up.
so right now, this is the current inline style for the button
style="width:74px; height:99px; background:url(images/icons.png) -0px -0px;"
Can I use:
document.getElementById('id').style.
for each one of those properties? How would I set the background:url one?
document.getElementById(id).style.cssText = 'width:74px; height:99px; background:url(images/icons.png) -0px -0px;'.