I'm looping through every selected element to truncate it to ~ 10 letters.
However I'm getting a TypeError: $(...).substring is not a function
and not sure why. Here's my code:
$('.post_text_div h1').each(function (e) {
var truncated = $(this).substring(0, 10)
// console.log('Truncated:', truncated);
$(this).text(truncated);
});
Any idea why?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…