自动添加邮箱后缀

1、 js文件下引入jquery.mailAutoComplete-4.0.js文件。

 

2、 在user.html文件中添加css样式。

代码如下:

<style>
.demo p {
width: 1000px;
margin-left: auto;
margin-right: auto;
}

.input {
padding: 12px;
width: 160px;
height: 8px;
}

.emailist {
border: 1px solid #20222a;
border-radius: 4px;
background-color: #fff;
color: #666;
font-size: 18px;
list-style-type: 0;
padding: 0;
margin: 0;
overflow: hidden;
margin-top: 20px;
}

.emailist li {
padding: 2px 11px;
cursor: pointer;
}

.emailist .on .emailist li:hover {
background-color: #eee;
}
</style>

 3. 在输入邮箱input里添加class。

4、 引入js和调用方法

 

代码如下:

<script type="text/javascript">
$(".yx").mailAutoComplete(); //使用方法
</script>

 

posted @ 2020-05-15 09:28  旺仔木子李  阅读(455)  评论(0编辑  收藏  举报