Click to See Complete Forum and Search --> : help requested.


scragar
08-02-2003, 05:10 AM
any one fancy helping me with this, I have had more problem's than I care to remember, but it's nearly finished.


I want to use JS to insert picture's, that change depending upon value's.

I think this can be done using if's, but how do I use document.write, or something else to insert an apropriate picture?

Just to demonstrate here is an exmple:
If (A == "xt"){
//insert image1
}
else {
//insert image2
}

AdamGundry
08-02-2003, 05:30 AM
As long as the document is open (i.e. it is executing the code on the first run through the page, not from an event handler), you can do this:

document.write('<img src="example.gif" >');

Adam

scragar
08-02-2003, 06:45 AM
thank's.