$('span').each(function(index, value) { var limit = 30; var myID = $(this).attr('id'); if(myID=='decoderip') { limit=60; } var mytext = $(this).text(); if (mytext.length > limit) { // console.log('span text: '+mytext); $(this).text(mytext.slice(0, limit) + '...'); } });
No comments:
Post a Comment