i want one of the options in drop down to be selected by default, Please see the code
<?php
class html{
function output(){
$html='<td>'.'<select id="out">';
for($i=0;$i<21;$i++){
$html.='<option value="$i" if($i==5) { selected } >'. $i .'</option>';
}
return $html;
}
}
echo html::output();
?>
Here i want value 5 to be selected by default,But I am getting selected value as 20. THANK YOU!!