Reputation:
It is possible to do something like the screenshot below? The input is of type number, and the "px" is automatically added by the input itself (and cannot be changed).
Upvotes: 2
Views: 335
Reputation: 138
you can get value of input by document.getElementById and then add 'px' to the value. finally you can set that value in input.
Upvotes: 1
Reputation: 2804
It's not a placeholder. Placeholders are only there to indicate to the user what input type is expected.
You could:
Upvotes: 2
Reputation:
You could overlay your input with a span
element that has the text px
at the right.
Upvotes: 3