使用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>
$(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>
相关文章推荐
- 使用JS和使用Jquery向select下添加option的区别
- Jquery multiselect 多选下拉框与ajax配合使用,动态拼接option。初始化默认选中多个,增加搜索框
- Jquery select option在html中使用
- Jquery对select 和option 的使用
- 使用jQuery对select中的option进行排序
- Jquery select option在html中使用
- IE8下JQuery clone 出的select元素使用append添加option异常解决记录
- select 使用jQuery拿到对应选中的option
- 使用(jquery) 实现select 对option 的动态选中
- jquery selectboxit 选项框使用
- 使用jQuery禁用、开启select标签方法
- jQuery怎么根据某个特定的值动态让select下的option选中
- 使用bBank.js解决IE下select标签innerHTML插入option的BUG
- 两个select之间option的互相添加操作(jquery实现)
- JS实现select去除option的使用注意事项
- jquery 和 原生js 获取<select><option></option></select>标签的值和文本
- jquery 对select中的option操作
- jquery为select添加option的代码探讨