您的位置:首页 > Web前端 > JQuery

使用jquery截断select的option值

2011-06-16 11:18 357 查看
  <script type="text/javascript">
   $(document).ready(function(){
    var count=$("#innermanage option").length;

    $("#innermanage option").each(function(){
     //$(this).text="1111"; 不起作用
     //$(this).attr("text","111111");不起作用
     s=$(this).text();
     $(this).attr("title",s);
     if(s.length>20)
     {
      s=s.substring(0,20)+"...";
     }
     $(this).html(s);
    });
   });
  </script>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  jquery function