Skip to content

Instantly share code, notes, and snippets.

@shaik2many
Created March 30, 2016 21:14
Show Gist options
  • Save shaik2many/1017e11620c2bc892af58cfa8c4514ae to your computer and use it in GitHub Desktop.
Save shaik2many/1017e11620c2bc892af58cfa8c4514ae to your computer and use it in GitHub Desktop.
<style>
greenText{
color:green; }
.blueText{ color:blue; }
.redText{ color:red; }
</style>
<select
onchange="this.className=this.options[this.selectedIndex].className"
class="greenText">
<option class="greenText" value="apple" >Apple</option>
<option class="redText" value="banana" >Banana</option>
<option class="blueText" value="grape" >Grape</option>
</select>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment