How can I shrink (and stretch if possible) a <input type="text" /> based on the input value? I mean, how to reduce the inner "margin" of the input element when the input is too short?
https://jsfiddle.net/hstutyex/3/
My real project uses datepicker and the format of date is noticeably shorter than the input, which causes a layout problem.
JS-less solution would be appreciated but if it's impossible using JS (and jQuery) is okay.