一.input输入框怎么禁止粘贴
<input type="text" value="" onpaste="return false;" />
二.IOS上input只读模式下点击有反应的解决方法
<input class="authentication-id-input" type="text"
v-model="authenticationInfo.identityNumber"
v-bind:readonly="inputReadOnly"
unselectable="on"
onfocus="this.blur()"/>
安卓下只用readonly = 'readonly'就行,但是ios下还要加unselectable = 'on' onfocus = 'this.blur()'
三.input框调用数字键盘
type="number"
四.input默认显示文字用placeholder
placeholder="请输入11位手机号"
placeholder 样式
.number-input::-webkit-input-placeholder{
font-size:34px;
font-family:PingFangSC-Regular,PingFang SC;
font-weight:400;
color:rgba(153, 153, 153, 1);
line-height:48px;
}
五.文本框输入手机号限制,只能输入不超过11位的数字,不能输入其他字符,移动端输入手机号文本框获取焦点后弹出数字键盘,而非拼音键盘,设置type="tel",是为了移动端弹出数字键。
<p class="input-number-p">请在下方输入预约手机号</p>
<div class="input-number">
<input id="inputNumber" type="tel" maxlength="11"/>
</div>