input相关的事件


css浏览器内置方法:

el-input:focus::-webkit-input-placeholder{
color: transparent;
}
/* Mozilla Firefox 4 to 18 */

el-input:focus:-moz-placeholder {
color: transparent;
}

/* Mozilla Firefox 19+ */

el-input:focus::-moz-placeholder {
color: transparent;
}

/* Internet Explorer 10+ */

el-input:focus:-ms-input-placeholder {
color: transparent;
}

js通过onfocus事件:清空placeholder占位符

<el-input v-model="userInfo.mobile"  οnfocus="this.placeholder=''" placeholder="sw-6512-6988-8778" style="width: 220px" />

监听回车事件keycode 为13,监听tab键事件为9

Keycode查询


Author: xt_xiong
转载要求: 如有转载请注明出处 :根据 CC BY 4.0 告知来自 xt_xiong !
评论
  标题