【web前端】15.input输入框的一些问题

一.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>

 

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值