Hello,
    I try to write a plugin which create some select in a div. I want to do that when an user click one select, it alert it's index of select in the div. Below is my code.but I can not receive select's index in the div.For example,when uer click the secend select , it alert(2);<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>无标题文档</title>
<script language="JavaScript" type="text/javascript" src="jquery-1.6.2.js"></script>
<script>
(function($){
 
        //plugin name - animatemenu
        $.fn.mydownlist=function(options) {
            var defaults = {
                selnum: 2,
title:'--请选择--',
onchange:function(){},
onclick:function(){}
            };
            var options = $.extend(defaults, options);
            return this.each(function() {
                  var o =options;
                  var obj = $(this);
  obj.empty();
                    var i=0;
for (i=0;i<o.selnum;i++)
{
  obj.append("<select sel_index='"+i+"'>"+"<option value='-1'>"+o.title+"</option>"+"</select>");
}
   $("select",obj).bind("click.mydownlist",defaults.onclick);
            });
        };})(jQuery);
 
</script>
</head><body>
<div id="mydownlist"></div><script>
   $('#mydownlist').mydownlist({
      selnum:3,
  title:'--请选择--',
  onclick:function(data){
     alert(data);
  }
   });
</script></body>
</html>