I'm creating a select Options dynamically under a using jquery. I have set the first item as selected using selected attribute. But i couldn't able to see the first item in select list. if i select second or third item the text is displaying in select tag.
EDIT : and one more thing i need to say,here am using jquery mobile framework.
Can any one help me.
here is my HTML script :
<select id="HRselectList"></select>
JS :
for(var x = 0; x <= 5; x++)
{
$('#HRselectList').append($("<option></option>").attr("value",x).text(x));
if(x==0)
{
$('#HRselectList option').attr("selected","selected");
}
}