Change background : Option Select ComboBox : Form Control JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Form Control » Option Select ComboBox »

 

Change background




<HTML>
<HEAD>
<TITLE>Change background</TITLE>
</HEAD>
<SCRIPT>
<!--
function bgChange(selObj) {
  newColor = selObj.options[selObj.selectedIndex].text;
  document.bgColor = newColor;
  selObj.selectedIndex = -1;
  }

//-->
</SCRIPT>
<BODY STYLE="font-family:Arial">
<B>Changing Background Colors</B>
<BR>
 <FORM>
   <SELECT SIZE="8" onChange="bgChange(this);">
   <OPTION>Red
   <OPTION>Orange
   <OPTION>Yellow
   <OPTION>Green
   <OPTION>Blue
   <OPTION>Indigo
   <OPTION>Violet
   <OPTION>White
   </SELECT>
 </FORM>
</BODY>
</HTML>


           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Form Control
» Option Select ComboBox