<script>
// 1.获取元素
var texter = document.getElementsByClassName('text');
var miamer = document.getElementsByClassName('mima');
//2.注册事件 获得焦点事件
texter.onfocus = function() {
if (this.value === '邮箱/ID/手机号') {
this.value = '';
}
}
texter.onblur = function() {
if (this.value === '') {
this.value = '邮箱/ID/手机号';
}
}
miamer.onfocus = function() {
if (this.value === '邮箱/ID/手机号') {
this.value = '';
}
}
miamer.onblur = function() {
if (this.value === '') {
this.value = '邮箱/ID/手机号';
}
}
</script>
世纪佳缘 用户名 显示隐藏内容
最新推荐文章于 2022-04-30 22:47:51 发布