<P> Annoyance
Ok guys,
Here it is:
I have a list box and a go button that populates 3 <P> tags using innerText. However I only want this to happen on one selection. If the user selects anything else I want the <P> tags to be emptied and revert back to their original state. I've tried the following:
<P ID="P1"></P>
<P ID="P2"></P>
<P ID="P3"></P>
<form name ="form1">
<select name = "Selected">
<option>0</option>
<option>1</option>
<option>2</option>
</select>
<input type ="button" name ="but1" value ="Go" onclick ="populate()">
</form>
<script language =javascript>
function populate(){
if(Selected.selectedIndex = 0){
P1.innerText="Some Text"
P2.innerText="Some Text"
P3.innerText="Some Text"}}
if(Selected.selectedIndex = 1){
P1.innerText=''
P2.innerText=''
P3.innerText=''}
if(Selected.selectedIndex = 2){
P1.innerText=''
P2.innerText=''
P3.innerText=''}
}
</script>
Help!
cheers
interrupt
__________________
\'sync\' <cr>
The name specified is not recognized as an internal or external command, operable program or batch file.
|