JQUERY text interception method
$.fn.substr = function(length,content){
$(this).each(function(i,item){
var val=$ (item).html();
if(!val) return;
if(val.length>length) {
val = val.substring(0,length);
val = content || "..."
$(item).html(val);
}
});
}
function subTdContent(){
$('td' ).substr(20);
}
My code: $.fn.substr = function(l,c){ $(this).each(function(i,item) |
The following two methods can solve the problem that the textarea row height automatically adapts to the height of the class content |
< ;td>The following two ways can solve the textarea row