How to create a Textbox with style that accepts only 2 characters
How do i create a html textbox which looks that it can accepts only 2开发者_运维知识库 characters .
<input type="text" maxlength="2" size="1"/>
what style do i need to apply so that textbox can be shown in such way it can accept 2 characters style ="???"
A simple width would do:
<input type="text" maxlength="2" size="1" class="twochar"/>
And the css:
.twochar
{
width:2em;
}
http://jsfiddle.net/kjl_42/vstMC/
精彩评论