Thread: JavaScript Help
View Single Post
Old 05-25-07, 03:32 PM   #5
technoid
Registered User
 
Join Date: Jul 2004
Location: Denton, Texas
Posts: 505
Default Re: JavaScript Help

Quote:
Originally Posted by fivefeet8
Replace with:

Code:
document.getElementById(div_id).style.backgroundImage = 'url("'+btn_path+'")';
Since it's concantenated, the javascript variable remains a variable with the appropriate value and the whole string evaluates correctly.
Thanks a lot that was exactly what I needed. In the mean time I got this to work since it took a variable ok.

document.getElementById(id).src = imgsrc;

But I like your way better and will use it because it works the way I wanted to do it but got messed up with the string variable getting evaluated wrong. Thanks Again!
__________________
Antec-SOLO | ASUS-P5Q-SE | C2D-E8600 | AC-Freezer-7-Pro | Seasonic-S12-550W | 3GB-KVR-PC2-6400 | GTX-560Ti | SB-XtremeGamer | Pioneer-BDR-205 | Samsung-S223B | Dell-U2412M
technoid is offline   Reply With Quote