add classes to the labels in radioButtonList

How can I add different classes to labels in radioButtonList.

I use this code:

echo CHtml::radioButtonList('kk','type',array('1'=>'','2'=>'','3'=>''),array(


 				'separator'=>' ',


and I get this code:

<input id="kk_0" type="radio" name="kk" value="1">

<label class="ddd" for="kk_0"></label>

<input id="kk_1" type="radio" name="kk" value="2">

<label class="ddd" for="kk_1"></label>

<input id="kk_2" type="radio" name="kk" value="3">

<label class="ddd" for="kk_2"></label>

I want get class="ddd1",class="ddd2",class="ddd3"

you can use nth-child selector:

<!DOCTYPE html>




p:nth-child(3) {

    background: #ffff00;


p:nth-child(4) {

    background: #ff0000;





<p>The first paragraph.</p>

<p>The second paragraph.</p>

<p>The third paragraph.</p>

<p>The fourth paragraph.</p>



Internet Explorer 8 and earlier versions do not support the :nth-child() selector.

Thank You! but I want know is it possible?

I don’t think it’s possible with CHtml::radioButtonList(). What do you intend to use the class for?