Hey guys,
I am looking for some help. I am trying to populate Radio buttons with JavaScript. What I have is two Radio buttons that when the page loads will display a random city next to them. So instead of saying “Desitination1” next the a radio button, it needs to say one of the cities below, and must pull different cities each time the page loads. Any help would be appreciated!
My cities:
var myVacations = ["Athens", "Madrid", "Tokyo", "Honolulu", "Sydney", "London", "Oslo", "Moscow", "Kingston", "Acapulco", "Brasilia", "Lima", "Chicago", "Toronto", "Cairo", "Egypt", "Capetown"];
my Radio buttons:
<form name="surveyForm">
<fieldset>
<legend>I would rather vacation in:</legend>
<label>
<input type="radio" name="pollRadio" id="optRadio1" value="" />
<span id="optSpan1" ></span>
</label>
<label>
<input type="radio" name="pollRadio" id="optRadio2" value="" />
<span id="optSpan1"></span>
</label>
</fieldset>
</form>