Add Attributes To The Options In Drop Down List


I need to add "onmouseover" for each options in drop down list like the sample html code given below.

<!DOCTYPE html>




function preferedBrowser()



alert("You prefer browsing internet with " + prefer);






Choose which browser you prefer:

<select id="browsers">

<option value="Chrome" onmouseover="preferedBrowser()">Chrome</option>

<option value="Internet Explorer" onmouseover="preferedBrowser()">Internet Explorer</option>

<option value="Firefox" onmouseover="preferedBrowser()">Firefox</option>





How do I add onmouseover like above? My code in yii given blow

$list = CHtml::listData(Address::model()->findAll('company_id=:company_id', array(':company_id'=>Yii::app()->session['compnay_id']), array('order' => 'company')), 'address_id', 'company');


echo CHtml::dropDownList('address', $address, $list, array('class'=>'input_lg utities-trigger'));


It would be much appropriated if any one can help on this.


Following below way it can help you lot

One way:

// htmloptions


‘id’ => ‘hide’,



Another way:

<script type="text/javascript">


//your code