I created this plugin as a colleague of mine asked to do similar functionality as the status dropdown on facebook…

It is very very simple, and could be extended with a lot of functionality, but I’ll leave that as a challenge for later or others.

Html:

  1. <input type="text" id="txtdropdown"/>
  2. <ul>
  3.   <li>1000</li>
  4.   <li>2000</li>
  5.   <li>3000</li>
  6.   <li>4000</li>
  7. </ul>

The first UL after the input field it will use as the definition for it’s dropdown.

Javascript usage:

  1. $(document).ready(function() {
  2.   // for this example
  3.   $(‘#txtdropdown’).textdropdown();
  4.  
  5.   // for searching by class name
  6.   $(‘input.textdropdown’).each(function() {
  7.     $(this).textdropdown();
  8.   });
  9. });

Check it out at the lab. Or grap the plugin directly.