alert($("select ").attr("label")); select里面没有label标签,打印不出来吧?
$("#istallocal").each(function(){
alert($("option").attr("label"));
});

解决方案 »

  1.   

    $(document).ready(function(){
      $("button").click(function(){
        var s = '';
        $("select ").find("[label]").each(function() {
          s += $(this).attr("label") + "\n";
        });
        alert(s);
      });
    });
      

  2.   

    $(document).ready(function(){
      $("button").click(function(){
        var label = $("#istallocal option:selected").attr('label');
        alert(label)   });
    });