Create a combobox by using HTML item list
- by erkan_ayan
How can I show only first li and hide the others?
I am trying to do a combobox via jQuery:
My jQuery script:
var drp = $('.drpdiv');
$(drp).each(function(index,value){
$(this).find('li:first').text()
$(this).find('li').hide();
alert($(this).find('li:first').text());
});
My html code:
<div class="drpdiv">
<ul class="drp">
<li>select option...</li>
<li>one</li>
<li>two</li>
<li>three</li>
</ul>
</div>