Comment Comment by turnipla This breaks my use case function shorten(text, length) const t = document.createElement('input') t.maxlength = length t.value = text return t.value } parent turnipla 6 years ago