看图像:
我希望设计像图像中的东西,用户输入4位一次性密码(OTP).现在我通过4个独立的输入实现了这一点,然后在javascript中组合了值:
<input type="text" class="form-control" placeholder="0" maxlength="1" />
<input type="text" class="form-control" placeholder="0" maxlength="1" />
<input type="text" class="form-control" placeholder="0" maxlength="1" />
<input type="text" class="form-control" placeholder="0" maxlength="1" />
Run Code Online (Sandbox Code Playgroud)
我不确定这是否正确.我认为必须有一些样式选项,通过这些样式选项,一个输入文本框将像图像中一样显示为分区文本框.是否可以使用bootstrap?如何将一个输入控件设置为输入的分区字段?