I want to truncate the input value by the available space for letters on the screen.
For example, if my input field can contain only 5 letters and after that the input 'scrolls' to the right (overflow) I want jQuery to limit only to 5 letters because that's the available and visible space to the user.
Bottom line - I want jQuery to truncate to the visible letters according to the input's overflow and remove the letters which are not visible.
Example:
I want jquery to truncate the text only to Lorem Ips although the value is actually Lorem Ipsum
How can I do that?

maxlengthattribute?<input type="text" maxlength="5" />