Q:

Laravel Form::select change background-color

I have this select:
 {{ Form::select('set', $sets, $prod->set_id, array('class' => 'form-select', 'id' => 'sel')) }}

I want to change the background-color of this select box when I choose a option. But I don't know how I can do it. Could you help me? I think that with javascript it´s possible, but... how? I have the color in my database, one color for one option.

A:

{{ Form::select(...., array('id' => 'sel'); }}
Then just the assign your id to the onChange event in your JS:
$(function(){
   $('sel').change(function(e) {
      document.getElementById('sel').style.color="magenta";
   });
});

