<script src="jquery-1.7.2.min.js"></script>
<script>
$(function(){
/*数组添加到下拉列表中
* var _mozi=;
$.each(_mozi,function(key,val){
//回调函数有两个参数,第一个是元素索引,第二个为当前值
var num=key+1;
$('.textPrepend').prepend('<option value ="'+key+'">'+val+'</option>');
})*/
/*json数组读取数据添加到select下拉列表中
* var people = { "programmers": }
people = eval(people.programmers);
for(var i=0; i<people.length; i++)
{
$('.textPrepend').prepend('<option value ="'+*+'">'+people*.firstName+'</option>');
}*/
/*遍历json对象添加到select下拉列表中
* var people=
$.each(people, function(idx, obj) {
$('.textPrepend').prepend('<option value ="'+idx+'">'+obj.firstName+'</option>');
});*/
});
$('.textclas').on('click',function(){
alert('取到的数值是:'+$('.textPrepend').val());
});
</script>