input length = value length & expands automatically according to value length
I want开发者_如何转开发 value length to be the same length as input field and expand automatically. When i write in some text it always has right or left free space. I don't want to define input size, i just want it to be the size of the text.
Can this be done ?
You have to use javascript for doing this. Using pure HTML this can't be done. On change
event of the text field, you can find the length of the text and the width/size and resize accordingly. Here is sample code.
精彩评论