xperience2
Programmer
- Jul 3, 2007
- 1
Apologies for the, what I'm sure is a very rooky question, but I don't do much in Javascript!
I need to conditionally display the word 'mile' or 'miles' depending on whether the variable is '1' or more than 1.
I currently have:
document.getElementById('distance').innerHTML = "You are " + stores[0].distance + " miles from your nearest store.";
Can someone write me an if ... then ... else statement to work with this?
Thanks!
Simon
I need to conditionally display the word 'mile' or 'miles' depending on whether the variable is '1' or more than 1.
I currently have:
document.getElementById('distance').innerHTML = "You are " + stores[0].distance + " miles from your nearest store.";
Can someone write me an if ... then ... else statement to work with this?
Thanks!
Simon